
Restarts all of the newly added computers after the join operation completes. Uses the Options parameter to specify the Win9xUpgrade option. This command adds the computers that are listed in the Servers.txt file to the Domain02 domain. Example 8: Add computers listed in a file to a new domain Add-Computer -ComputerName (Get-Content Servers.txt) -DomainName Domain02 -Credential Domain02\Admin02 -Options Win9xUpgrade -Restart Permission to join the computer to the Domain02 domain. It uses the Credential parameter to specify a user account that has The command uses the credential of the current user to connect to the Server01 computer and unjoin This command moves the Server01 computer to the Domain02 and changes the machine name to Server044. Example 7: Move a computer to a new domain and change the name of the computer Add-Computer -ComputerName Server01 -DomainName Domain02 -NewName Server044 -Credential Domain02\Admin01 -Restart It uses the Restart parameter to restart all three computers after the move is complete. Parameter to specify a user account that has permission to join the computers to the Domain02ĭomain. It uses the UnjoinDomainCredential parameter to specify a userĪccount that has permission to unjoin the computers from the Domain01 domain and the Credential It uses the LocalCredential parameter to specify a user account that has permission to connect This command moves the Server01 and Server02 computers, and the local computer, from Domain01 to Example 6: Move a group of computers to a new domain Add-Computer -ComputerName Server01, Server02, localhost -DomainName Domain02 -LocalCredential Domain01\User01 -UnjoinDomainCredential Domain01\Admin01 -Credential Domain02\Admin01 -Restart It uses the Restart parameter to restart the computer after the join operation completesĪnd the Force parameter to suppress user confirmation messages. The Credential parameter to specify a user account that has permission to join computers to theĭomain. Parameter to specify a user account that has permission to connect to the Server01 computer. This command adds the Server01 computer to the Domain02 domain. Example 5: Add a local computer to a domain using credentials Add-Computer -ComputerName Server01 -LocalCredential Server01\Admin01 -DomainName Domain02 -Credential Domain02\Admin02 -Restart -Force


The organizational unit for the new accounts. This command adds the local computer to the Domain02 domain. Example 4: Add a local computer to a domain using the OUPath parameter Add-Computer -DomainName Domain02 -OUPath "OU=testOU,DC=domain,DC=Domain,DC=com" The command uses the PassThru and Verbose parameters to get detailed information about the This command adds the local computer to the Domain01 domain by using the Domain01\DC01 domain Example 3: Add a local computer to a domain Add-Computer -DomainName Domain01 -Server Domain01\DC01 -PassThru -Verbose This command adds the local computer to the Workgroup-A workgroup. Example 2: Add a local computer to a workgroup Add-Computer -WorkgroupName WORKGROUP-A This command adds the local computer to the Domain01 domain and then restarts the computer to make

Examples Example 1: Add a local computer to a domain then restart the computer Add-Computer -DomainName Domain01 -Restart To get the results of the command, use the Verbose and PassThru parameters. You can use the parameters of this cmdlet to specify an organizational unit (OU) and domainĬontroller or to perform an unsecure join. It also creates a domain account if the computer is added to The Add-Computer cmdlet adds the local computer or remote computers to a domain or workgroup, or Add the local computer to a domain or workgroup.
