Add computer to domain using PowerShell

Spread the words

We are assuming that you are running PowerShell with elevated privileges and with an account that has the rights to join computers to domain.

Use the Add-Computer cmdlet.

I’m also adding the computer account to a child OU called WKS and the verbose parameter to get detailed information during the process.

Add-Computer –DomainName frenchitguy.com –OUPath “OU=WKS, OU=IT, OU=FR, DC=Frenchitguy, DC=com” –Credential frenchitguy.com\administrator –passthru –verbose

addcom

Enter the password and click yes.

addcompass

See the result

addcomresult

Restart the computer now with shutdown /r

Your computer is on the domain now

win10login

visuOU

Cheers.

Be the first to comment on "Add computer to domain using PowerShell"

Leave a comment

Your email address will not be published.


*