Question:
I have just done a fresh installation of windows 7 professional, and I would like to join my pc to domain through powershell but getting some error here is the code which I am using
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Add-Computer -ComputerName HMD-PC002 -DomainName mydomain -Credential mydomain\Administrator Add-Computer : Computer 'HMD-PC002' failed to join domain 'mydomain' from its current workgroup 'WORKGROUP' with following error message: Unknown error (0xa8b). At C:\Users\HMDPC002\Desktop\add-pc_to_Domain.ps1:8 char:1 + Add-Computer -ComputerName HMD-PC002 -DomainName mydomain -Credential mydomain\A ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (HMD-PC002:String) [Add-Computer], InvalidOperationException + FullyQualifiedErrorId : FailToJoinDomainFromWorkgroup,Microsoft.PowerShell.Commands.AddComputerComma |
Answer:
There was an easy solution to this, i didnt configure my dns server i had to change it manually and after populating the two field i ran the following script and it worked
1 2 |
Add-Computer -DomainName mydomain -Credential mydomain\Administrator -Restart |
However i want powershell to change the dns setting i will ask this in a separate question