Add-Computer

I was building some test machines yesterday and needed to add them to the domain. As they were Windows 2008 R2 with PowerShell v2 I decided to try Add-Computer.

Add-Computer -DomainName mydomain -Credential mydomain\myaccount; restart-computer

You will be prompted for the password.

This only works on the local computer – you can’t add a remote machine.

Simple and effective command.

Published Tue, Jan 12 2010 13:52 by RichardSiddaway

Comments

# re: Add-Computer

Thanks for the one liner it works like a dream.

Tuesday, March 29, 2011 3:30 AM by Shakiel

# Powershell and Active Directory

Hi Richard,

I am Sachin, new to powershell and Active directory. I am creating a web based application(asp.net, C#) which should create a new user/group in Active Directory. I want to run that application on my laptop which is not part of any domain. But, the server machine whose active directory i want to call is a domain server. Can i update Active directory content from any machine (Public) if I have required credentials ?

Please share some code samples snippet. It's urgent!!!

Tuesday, February 28, 2012 1:44 AM by Sachin

# re: Add-Computer

Please the comments on the forum at powershell.com/.../9017.aspx

about this question

Saturday, March 03, 2012 10:05 AM by RichardSiddaway

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: