Skip to content

Instantly share code, notes, and snippets.

@ianunruh
Created September 12, 2014 03:11
Show Gist options
  • 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