K2000: Disabled Machine in AD after image
I'm trying to deploy an image to a brand new machine out of the box (E5250), and when it gets to the final post-install script which joins the domain, it joins - but when when I go to login to the domain, it gives me this error:
security database on the server does not have a computer account for this workstation trust relationship
Looking in AD, it has the down arrow next to the machine name. The only way I've been able to fix it is to un-join / re-join the domain. It's a brand new machine, and I'm not giving it a name of any machine that exists on AD already. I heard that this is happening on random machines from some of the techs in our department, so it seems to be random, but still occuring randomly.
Any ideas? Is this a problem with the image creation or perhaps the join domain script? We're using powershell to join. We use a bat file to call the powershell:
powershell.exe -nologo -executionpolicy bypass -noprofile -file wnhs.ps1
$password= "xxx" | ConvertTo-SecureString -asPlainText -Force
#enter user account that will be used to join domain
$cred= New-Object System.Management.Automation.PSCredential($user,$password)
#edit for OU path
$oupath = 'ou=North,ou=HighSchools,ou=D200Computers,dc=CUSD200,dc=LOCAL'
#add computer to OU
Add-Computer -domainname $domain -oupath $oupath -Credential $cred -ErrorAction silentlycontinue
#add computer to domain
Add-Computer -DomainName $domain -Credential $cred
There are no answers at this time