Skip to content

Instantly share code, notes, and snippets.

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