what is the command-line entry for joining a computer to a domain?

Active Directory (Advertizement) is a decades-quondam applied science that thousands of organizations use every day. To take reward of Ad, you must join computers to an Advertizement domain. You may not realize at that place are many different ways to practise that, some better than others. Read on to learn how.

Do y'all accept compromised passwords in your Active Directory? Find out with Specops Password Auditor Free.

In this tutorial, you volition acquire how to add a reckoner to a domain using the Windows GUI and command-line with the netdom utility and PowerShell.

Prerequisites

If you'd similar to follow along with all of the steps in this tutorial, ensure you have the following:

  • An Active Directory domain. This tutorial will exist using a domain chosen homelab.local.
  • A Windows x Pro, Enterprise, or Education calculator in a workgroup that can access an Advert domain controller. Non all versions of Windows 10 tin be joined to a domain. This tutorial will use a computer chosen Win10Demo.
  • An AD user business relationship with permissions to add together a computer to a domain. Observe more information on how to find what permissions are needed here.
  • Access to Active Directory Users and Computers (ADUC) on a domain controller (to confirm the domain bring together).
  • The Remote Server Assistants Tools (RSAT) packet to utilise the command-line

Adding a Computer to a Domain via the GUI

I of the most mutual ways to add a estimator to an Advertizement domain is the GUI. This approach is adept when you need to merely add a single or a few computers at once. This method is non good for calculation multiple computers at once. That'll be later.

Assuming you're on a Windows ten workgroup figurer that can access an existing domain controller:

1. Run the command sysdm.cpl. This control will open the System Backdrop control console applet.

System Properties Dialog box
System Backdrop Dialog box

2. On the Organisation Properties screen, click the Change button. This button volition bring upwards the Computer Proper name/Domain Changes dialog box.

Change option in System Properties Dialog box
Change selection in System Backdrop Dialog box

3. You can run into below this figurer is in a workgroup called WORKGROUP. In the Computer Name/Domain Changes dialog box, click on the Domain radio option to input a domain to add this computer to.

Computer Name/Domain Name Change Dialog box

Reckoner Name/Domain Name Change Dialog box

iv. Input the name of the domain to add the computer to in the Domain box and click OK. The computer volition then attempt to contact a domain controller and add itself to the domain.

Computer Name/Domain Name Change Dialog box

Computer Proper noun/Domain Name Alter Dialog box

If your figurer is not able to contact the domain name you entered immediately, it throws the below error: If the computer cannot contact a domain controller, ensure the estimator's DNS server points to a domain controller. The calculator must exist able to detect the DNS SRV tape to find a domain controller.

5. If the computer can contact a domain controller, it will prompt you for a username and countersign, as shown below. Input a user account with permissions to add together this estimator to the domain and click OK.

Username and Password Prompt
Domain Join Credentials Dialog box

six. If all goes well, yous will receive a message welcoming you to the domain as shown below. At this time, the reckoner creates an AD computer object. Click OK.

Successfully added to Domain Notification
Successfully added to Domain Notification

7. Click on OK again to ostend the need to restart the computer.

Restart your computer Notification
Restart your computer Notification

8. You'll then exist redirected back to the Arrangement Properties dialog box, only now you will see a alarm (Changes will take effect after you restart this calculator.) Click on Close.

System Properties
Arrangement Properties dialog box mail service joining to domain

9. Once y'all click on Close, Windows volition prompt you lot to restart at present. Click on Restart now to restart the computer immediately.

Local computer Restart prompt
Local computer Restart prompt

Adding a Local Computer to a Domain via Settings app

Steps explained beneath are only available in Windows10 20H2 version. These steps may change in future windows10 versions.

one. Right click on first bill of fare and click settings.

Settings option in start menu
Settings selection in start menu

2. Under settings, click on accounts

Accounts option in Settings app
Accounts choice in Settings app

3. In the side by side page, click on "Access Work or School" selection and click on connect option to the right.

Access work or school option in settings
Access work or school pick in settings

4. As nosotros are going to join this machine to local Active Directory Domain, in the Microsoft account dialog box, click "Bring together this device to local Active Directory Domain" choice and click Next.

Join this device to local Active Directory Domain option
Bring together this device to local Active Directory Domain option

v. In the next folio, enter your domain proper name and click Adjacent.

Domain Name dialog box
Domain Proper name dialog box

vi. If the computer can contact a domain controller, information technology will prompt you for a username and password, equally shown beneath. Input a user account with permissions to add together this computer to the domain and click OK.

Credentials dialog box
Credentials dialog box

7. In the next page, select the account type who volition use this automobile.

  • If you select ambassador, the userid that yous used to add this automobile to domain, will exist added to the local administrators grouping on the machine.
  • If you select standard user, information technology will not add together the userid to local administrators group. You lot can too skip information technology and continue to adjacent folio. For this demo, lets select standard user and click Side by side.
Account type prompt
Account type prompt

8. Click Restart now to restart the estimator immediately.

Restart prompt
Restart prompt

nine. Once restarted you tin login to the automobile with a domain user id.

Adding a Local Computer to a Domain via Netdom

And then far, you lot have seen how to add together a Windows 10 computer to the domain via GUI, but y'all don't have to use the GUI. Instead, you can use the control-line using the netdom utility. Netdom is a control-line tool that comes with the RSAT packet.

Assuming you lot're on a Windows 10 workgroup calculator that can access an existing domain controller:

i. Open cmd.exe as administrator.

2. Run netdom join providing the following parameters.

Netdom requires a computer name right after the bring together parameter. If you're using this control on other computers, supervene upon the value with the variable %computername% to always represent the local computer.

            netdom.exe join %computername% /domain:DomainName /UserD:DomainName\UserName /PasswordD:Countersign          
Netdom command output
Netdom command output

three. Now restart the computer and the computer will be joined to the domain.

Adding a Local Calculator to a Domain via PowerShell

If you have many computers to add to a domain, have an onboarding automation process, or prefer the command-line, you tin use PowerShell to add a computer to a domain.

Assuming you lot're on a Windows 10 workgroup figurer that tin access an existing domain controller:

ane. Open upwardly Windows PowerShell ensuring you run it as administrator.

In the PowerShell console, run the Add-Computer cmdlet. This cmdlet performs the same action every bit adding a computer to a domain via the GUI. Specify the domain proper name to add the computer to with the DomainName parameter and optionally specify the Restart parameter to restart the computer when complete automatically.

You tin can also specify the Credential parameter to specify the username and countersign sooner. Run into this article for more information. If you'd like to add a computer to a dissimilar OU upon creation, specify the OUPath parameter. For more options, run Get-Help Add-Computer -Full.

            Add-Computer -DomainName DomainName -Restart          
Add-Computer cmdlet credentials prompt
Add together-Calculator cmdlet credentials prompt

Add a Local Computer to a Domain Via WMI

To ensure this tutorial covers all means yous tin can add together a computer to a domain, allow'south continue with a lesser-known method of using Windows Management Instrumentation (WMI). WMI is a ubiquitous part of Windows that contains loads of information most a PC and can perform actions on it.

To add together a local computer to a domain with WMI, you need to invoke a WMI method. This method performs the same task every bit using netdom or the Add-Computer PowerShell cmdlet.

Y'all can invoke WMI methods in many dissimilar ways. For this tutorial, let's focus on ii ways using the *wmic* command-line utility and PowerShell.

Using WMIC

To add a computer to a domain with WMIC:

one. Open up a command prompt (cmd.exe) equally administrator.

two. Run the below command. This command:

  • Specifies the local computer using a where query (where name="%computername%")
  • Invoke the WMI method joindomainorworkgroup (call joindomainorworkgroup) that's a part of the Win32_ComputerSystem WMI class (computersystem)
  • Specifies advisable bitwise operators to bring together the domain (fjoin options 3)
  • Adds the computer to the homelab.local domain (homelab.local) authenticating with the labadmin user account (username="homelab\labadmin Password="surreptitious")
            wmic computersystem where proper noun="%computername%" call joindomainorworkgroup fjoinoptions=3 name="homelab.local" username="homelab\labadmin" Password="surreptitious"          
WMIC command output
WMIC control output

iii. When completed, restart the calculator.

Using PowerShell's Go-WmiObject Cmdlet

You can also invoke the JoinDomainOrWorkgroup WMI method using PowerShell. To exercise so:

ane. Open PowerShell as ambassador.

2. Run the following command. This command performs the same task as wmic does above using the aforementioned arguments.

            (Get-WMIObject -NameSpace "Root\Cimv2" -Form "Win32_ComputerSystem").JoinDomainOrWorkgroup("homelab.local","secret","homelab\labadmin",$null,iii)          
Get-WMIObject command output
Get-WMIObject command output

iii. When completed, restart the computer.

Adding Computers Remotely to a Domain

Throughout this tutorial, you've learned how to add a reckoner to a domain equally you're sitting in front of that actual computer. Simply what happens when y'all tin't sit in forepart of that computer, or you have many computers to add? In that case, PowerShell is your best friend.

To add together computers to a domain remotely, you could either choose to use the WMI method in PowerShell as describe above but use the ComputerName parameter on the Become-WmiObject cmdlet or use PSRemoting.

To bring together remote computers to domain remotely, invoke the Add together-Computer PowerShell cmdlet. Just this time, utilize the ComputerName parameter.

To run the Add-Computer cmdlet remotely, you must ensure that PSRemoting is enabled on all remote computers.

one. On your local workstation (not the figurer to add together to a domain), open PowerShell every bit ambassador.

2. Run the beneath command. This command:

  • Adds the remote figurer called win10demo (-ComputerName win10demo) to the homelab.local domain (-DomainName homelab.local).
  • Uses the user01 local user on win10demo to cosign to the remote computer (-LocalCredential win10demo\user01)
  • Uses the labadmin domain business relationship to cosign to the domain to add the calculator account (-Credential homelab\labadmin).
  • Volition restart the reckoner automatically after it completes (-Restart)
            Add-Reckoner -ComputerName win10demo -LocalCredential win10demo\user01 -DomainName homelab.local -Credential homelab\labadmin -Restart          

Once invoked, the Add-Computer cmdlet will and so prompt you for passwords for the user01 and labadmin accounts. When complete, PowerShell volition restart the remote calculator automatically.

By default, the Add-Computer cmdlet will not restart the remote computer if a user is logged in. To override this, specify the Strength switch parameter to ever to restart the remote computer.

When a computer is added to a domain, it creates a calculator object. To ensure the computer created the computer object equally expected, let'due south open Agile Directory Users and Computers (ADUC) to confirm.

1. RDP to your domain controller and open up Active Directory Users and Computers (ADUC) or open ADUC on your local computer if you accept the Remote Server Administration Tools (RSAT) package installed.

two. In ADUC, expand the domain name node (homelab.local in this case) and click on the Computers container. You should run into the computer object added in the previous section.

Past default, all computers that are added to a domain will be added under the Computers container.

Active Directory Users and Computers snapin
Active Directory Users and Computers snapin

3. Back on the Windows ten computer, now log on with any AD user account by clicking on Other User on the login screen.

Login as Other user option post domain joined
Login every bit Other user choice post domain joined

You can now see your domain name under the Password box equally shown below.

Domain name while logging in
Domain name while logging in

Do you have compromised passwords in your Active Directory? Notice out with Specops Countersign Auditor Costless.

Conclusion

Throughout this commodity, yous've seen multiple ways to add computers to an Advertizing domain. Each method has advantages and disadvantages, only y'all should now have all of the options in front of you lot.

Now that you know all of the ways to add a estimator to a domain, how will you add together your next figurer to a domain?

teecethoutter.blogspot.com

Source: https://adamtheautomator.com/add-computer-to-domain/

0 Response to "what is the command-line entry for joining a computer to a domain?"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel