Export (0) Print
Expand All

Joining a Computer to a Domain

Updated: February 28, 2009

Applies To: Windows Server 2008 R2

This topic explains how to use the Active Directory module for Windows PowerShell to join a computer to a domain.

The following example demonstrates how to add the local computer to the Fabrikam.com domain by using the current logged-on user credentials. You must run this command on the local computer:

Add-Computer -DomainOrWorkgroupName Fabrikam

The following example demonstrates how to add the computer FabrikamClient1 to the FabrikamGroup workgroup using the current logged-on user credentials. You must run this command on the local computer:

Add-Computer -FabrikamClient1 -WGN FabrikamGroup

The following example demonstrates how to add the computer S1 to the domain Fabrikam.com. The domain controller that performs the join is specified by the -Server parameter, using the current logged-on user credentials. You must run this command on the local computer:

Add-Computer S1 -DN Fabrikam -Server FabrikamDC1

The following example demonstrates how to add the local computer on which this command is being executed to the Fabrikam.com domain. The local computer is added to the organizational unit (OU) in the directory that is specified by the OUPath parameter, using the current logged-on user credentials. You must run this command on the local computer:

Add-Computer -DomainOrWorkgroupName Fabrikam -OUPath OU=testOU,DC=domain,DC=Domain,DC=com

The following example demonstrates how to add the computer S1 to the Fabrikam.com domain using the specified credentials Fabrikam\Administrator. When the operation is complete, the computer restarts automatically. You must run this command on the local computer:

Add-Computer S1 Fabrikam Fabrikam\Administrator -Reboot

For a full explanation of the parameters that you can pass to Add-Computer, at the Active Directory module command prompt, type Get-Help Add-Computer –detailed, and then press ENTER.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2015 Microsoft