Advertisement
Guest User

Untitled

a guest
Jan 25th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. $domain = "ADATUM.com"
  2. $username = "$domain\myUserAccount"
  3. $password = "myPassword!" | ConvertTo-SecureString -asPlainText -Force;
  4. $credential = New-Object System.Management.Automation.PSCredential($username,$password)
  5.  
  6. $DomainJoinArgs = @{
  7. 'DomainName' = $domain;
  8. 'Credential' = $credential;
  9. 'OuPath' = "";
  10. 'Server' = "[servername here]";
  11. }
  12.  
  13. Add-Computer @DomainJoinArgs -PassThru
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement