Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ####
- # Run this script in the user data portion of windows images you want to join to your domain.
- # User needs rights to join computers to the domain.
- ####
- <powershell>
- $domain = "mydomain.local"
- $password = "Password1" | ConvertTo-SecureString -asPlainText -Force
- $username = "mydomain\username"
- $credential = New-Object System.Management.Automation.PSCredential($username,$password)
- Add-Computer -DomainName $domain -Credential $credential -Restart
- </powershell>
Add Comment
Please, Sign In to add comment