Guest User

Untitled

a guest
Nov 9th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. ####
  2. # Run this script in the user data portion of windows images you want to join to your domain.
  3. # User needs rights to join computers to the domain.
  4. ####
  5.  
  6. <powershell>
  7. $domain = "mydomain.local"
  8. $password = "Password1" | ConvertTo-SecureString -asPlainText -Force
  9. $username = "mydomain\username"
  10. $credential = New-Object System.Management.Automation.PSCredential($username,$password)
  11. Add-Computer -DomainName $domain -Credential $credential -Restart
  12. </powershell>
Add Comment
Please, Sign In to add comment