PowerShell for Windows Admins

Nov 18 2010   1:25PM GMT

Joining a domain

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

I was creating a new virtual machine and decided to test the JoinDomainOrWorkgroup method of the Win32_ComputerSystem class

The syntax is relatively straight forward

$comp = Get-WmiObject Win32_ComputerSystem
$password = "Gu3ssWh4t"
$user = "Manticore\Richard"
$domain = "Manticore"
$comp.JoinDomainOrWorkgroup($domain, $password, $user, $null, 3)

It kept failing with a 1316 return code.  Couldn’t find a reference to that so eventually tried using Add-Computer.  That told me the computer account already existed.  OOOPS. Got the name wrong.  One quick rename later and we’re in business

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: