Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $domain = "OpMeis.local"
  2. $password = "Password1" | ConvertTo-SecureString -asPlainText -Force
  3. $username = "$domain\administrator"
  4. $credential = New-Object System.Management.Automation.PSCredential($username,$password)
  5. $ouPath="OU=Computers,OU=Bedrift,DC=OpMeis,DC=local"
  6. add-computer -Credential $credential -DomainName $domain -OUPath $ouPath -restart -force
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement