Looking for k2000 "Join Domain" powershell script............
I was recently checking out the KKE archive and saw this being referred to and was hoping someone could pass this along
Community Chosen Answer
I use this. This will attempt to join a specific OU. If the record already exists in that OU it will join the domain.
$domain= "domain.org" $password= "<user password>" | ConvertTo-SecureString -asPlainText -Force #enter user account that will be used to join domain $user= "$domain\<user>" $cred= New-Object System.Management.Automation.PSCredential($user,$password) #edit for OU path $oupath = 'OU=Laptops,OU=Workstations,DC=domain,DC=ORG' #add computer to OU Add-Computer -domainname $domain -oupath $oupath -Credential $cred -ErrorAction silentlycontinue #add computer to domain Add-Computer -DomainName $domain -Credential $cred