Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $domain = "test.com"
- $password = "Mypass" | ConvertTo-SecureString -asPlainText -Force
- $username = "$domain\administrator"
- $credential = New-Object System.Management.Automation.PSCredential($username,$password)
- $ouPath="OU=workstations,DC=test,DC=com"
- add-computer -Credential $credential -DomainName $domain -OUPath $ouPath -restart -force
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement