Skip to content

Instantly share code, notes, and snippets.

@ianunruh
Created September 12, 2014 03:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianunruh/09d6189bf0b55e680920 to your computer and use it in GitHub Desktop.
Save ianunruh/09d6189bf0b55e680920 to your computer and use it in GitHub Desktop.
Join Windows to AD
#ps1_sysnative
$domain = "YOURDOMAIN"
$password = "YOURPASSWORD" | ConvertTo-SecureString -asPlainText -Force
$username = "$domain\Administrator"
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
Add-Computer -DomainName $domain -Credential $credential
Restart-Computer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment