---
title: "Add a Computer to a Domain and Take Advantage of AD"
description: "Learn how to add a computer to a domain via the GUI, netdom, PowerShell and even remotely in this post."
canonical: "https://adamtheautomator.com/add-computer-to-domain/"
---

# Add a Computer to a Domain and Take Advantage of AD

> Learn how to add a computer to a domain via the GUI, netdom, PowerShell and even remotely in this post.

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

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![How to Add a Computer to a Domain (GUI and PowerShell)](https://adamtheautomator.com/wp-content/uploads/2021/04/How-to-Add-a-Computer-to-a-Domain-All-the-Ways.jpg)

# How to Add a Computer to a Domain (GUI and PowerShell)

[![](https://secure.gravatar.com/avatar/c14b031fe4a12b0e3f4d1e112e37261df83921ddc370cdafbad2a614e36f0cf4?s=192&d=mm&r=g)Chaitanya](https://adamtheautomator.com/author/chaitanya-g/)8 April 20219 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[Active Directory](/tag/active-directory/)

Table of Contents

*   [Prerequisites](#h-prerequisites)
*   [Adding a Computer to a Domain via the GUI](#h-adding-a-computer-to-a-domain-via-the-gui)
*   [Adding a Local Computer to a Domain via Settings app](#adding-a-local-computer-to-a-domain-via-settings-app)
*   [Adding a Local Computer to a Domain via Netdom](#h-adding-a-local-computer-to-a-domain-via-netdom)
*   [Adding a Local Computer to a Domain via PowerShell](#h-adding-a-local-computer-to-a-domain-via-powershell)
*   [Add a Local Computer to a Domain Via WMI](#h-add-a-local-computer-to-a-domain-via-wmi)
*   [Using WMIC](#h-using-wmic)
*   [Using PowerShell’s Get-WmiObject Cmdlet](#h-using-powershell-s-get-wmiobject-cmdlet)
*   [Adding Computers Remotely to a Domain](#h-adding-computers-remotely-to-a-domain)
*   [Confirming Creation of the AD Computer Account](#h-confirming-creation-of-the-ad-computer-account)
*   [Conclusion](#h-conclusion)

Active Directory (AD) is a decades-old technology that thousands of organizations use every day. To take advantage of AD, you must join computers to an AD domain. You may not realize there are many different ways to do that, some better than others. Read on to learn how.

Not a reader? Watch this related video tutorial!

**_Not seeing the video? Make sure your ad blocker is disabled._**

> _A FREE read only tool that scans your AD and generates multiple interactive reports for you to measure the effectiveness of your password policies against a brute-force attack. [Download Specops Password Auditor now!](https://specopssoft.com/product/specops-password-auditor/?utm_source=ata&utm_medium=referral&utm_campaign=na_2023_ata&utm_content=mention)_

In this tutorial, you will learn how to add a computer to a domain using the Windows GUI and command-line with the _netdom_ utility and PowerShell.

## Prerequisites

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

*   An Active Directory domain. This tutorial will be using a domain called _homelab.local_.
*   A Windows 10 Pro, Enterprise, or Education computer in a workgroup that can access an AD domain controller. Not all versions of Windows 10 can be joined to a domain. This tutorial will use a computer called _Win10Demo_.
*   An AD user account with permissions to add a computer to a domain. Find more information on how to discover what permissions are needed [here](https://www.prajwaldesai.com/allow-domain-user-to-add-computer-to-domain/).
*   Access to Active Directory Users and Computers (ADUC) on a domain controller (to confirm the domain join).
*   The [Remote Server Administration Tools (RSAT) package](https://adamtheautomator.com/powershell-import-active-directory/#Install_RSAT_Remote_Server_Administration_Tools) to use the command-line

## Adding a Computer to a Domain via the GUI

One of the most common ways to add a computer to an AD domain is the GUI. This approach is good when you need to just add a single or a few computers at once. This method is not good for adding multiple computers at one time. That’ll be later.

Assuming you’re on a Windows 10 workgroup computer that can access an existing domain controller:

1\. Run the command _sysdm.cpl_. This command will open the **System Properties** control panel applet.

![System Properties Dialog box](https://adamtheautomator.com/wp-content/uploads/2021/04/Untitled-2021-04-07T102410.771.png)

System Properties Dialog box

2\. On the **System Properties** screen, click the **Change** button. This button will bring up the **Computer Name/Domain Changes** dialog box.

![Change option in System Properties Dialog box](https://adamtheautomator.com/wp-content/uploads/2021/04/Untitled-2021-04-07T102455.649.png)

Change option in System Properties Dialog box

3\. You can see below this computer 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](https://adamtheautomator.com/wp-content/uploads/2021/04/Untitled-2021-04-07T102556.001.png)

  
Computer Name/Domain Name Change Dialog box

4\. Input the name of the domain to add the computer to in the **Domain** box and click **OK**. The computer will then attempt to contact a domain controller and add itself to the domain.

![Computer Name/Domain Name Change Dialog box](https://adamtheautomator.com/wp-content/uploads/2021/04/Untitled-2021-04-07T102715.196.png)

  
Computer Name/Domain Name Change Dialog box

Related:[The Trust Relationship Between This Workstation and the Primary Domain Failed](https://adamtheautomator.com/the-trust-relationship-between-this-workstation-and-the-primary-domain-failed/)

> If your computer 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 computer’s DNS server points to a domain controller. The computer must be able to find the DNS SRV record to find a domain controller._

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

![Username and Password Prompt](https://adamtheautomator.com/wp-content/uploads/2021/04/Untitled-2021-04-07T102940.703.png)

Domain Join Credentials Dialog box

6\. If all goes well, you will receive a message welcoming you to the domain as shown below. At this time, the computer creates an [AD computer](https://adamtheautomator.com/get-adcomputer/) object. Click **OK**.

Related:[Get-ADComputer: Find Computers in OUs in PowerShell](https://adamtheautomator.com/get-adcomputer/)

![Successfully added to Domain Notification](https://adamtheautomator.com/wp-content/uploads/2021/04/Untitled-2021-04-07T103037.998.png)

Successfully added to Domain Notification

7\. Click on **OK** again to confirm the need to restart the computer.

![Restart your computer Notification](https://adamtheautomator.com/wp-content/uploads/2021/04/Untitled-2021-04-07T103211.198.png)

Restart your computer Notification

8\. You’ll then be redirected back to the **System Properties** dialog box, but now you will see a warning (**Changes will take effect after you restart this computer.**) Click on **Close**.

![System Properties](https://adamtheautomator.com/wp-content/uploads/2021/04/Untitled-2021-04-07T103248.287.png)

System Properties dialog box post joining to domain

9\. Once you click on **Close**, Windows will prompt you to restart now. Click on **Restart now** to restart the computer immediately.

![Local computer Restart prompt](https://adamtheautomator.com/wp-content/uploads/2021/04/Untitled-2021-04-07T103345.629.png)

Local computer Restart prompt

## Adding a Local Computer to a Domain via Settings app

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

1\. Right click on start menu and click settings.

![Settings option in start menu](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-33.png)

Settings option in start menu

2\. Under settings, click on accounts

![Accounts option in Settings app](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-34.png)

Accounts option in Settings app

3\. In the next page, click on “Access Work or School” option and click on connect option to the right.

![Access work or school option in settings](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-35.png)

Access work or school option in settings

4\. As we are going to join this machine to local Active Directory Domain, in the Microsoft account dialog box, click “Join this device to local Active Directory Domain” option and click Next.

![Join this device to local Active Directory Domain option](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-36.png)

Join this device to local Active Directory Domain option

5\. In the next page, enter your domain name and click Next.

![Domain Name dialog box](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-37.png)

Domain Name dialog box

6\. If the computer can contact a domain controller, it will prompt you for a username and password, as shown below. Input a user account with permissions to add this computer to the domain and click **OK**.

![Credentials dialog box](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-38.png)

Credentials dialog box

7\. In the next page, select the account type who will use this machine.

*   If you select administrator, the userid that you used to add this machine to domain, will be added to the local administrators group on the machine.
*   If you select standard user, it will not add the userid to local administrators group. You can also skip it and continue to next page. For this demo, lets select standard user and click Next.

![Account type prompt](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-39.png)

Account type prompt

8\. Click Restart now to restart the computer immediately.

![Restart prompt](https://adamtheautomator.com/wp-content/uploads/2021/05/Untitled-40.png)

Restart prompt

9\. Once restarted you can login to the machine with a domain user id.

## Adding a Local Computer to a Domain via Netdom

So far, you have seen how to add a Windows 10 computer to the domain via GUI, but you don’t have to use the GUI. Instead, you can use the command-line using the _netdom_ utility. Netdom is a command-line tool that comes with the RSAT package.

Assuming you’re on a Windows 10 workgroup computer that can access an existing domain controller:

1\. Open up _cmd.exe_ as administrator.

2\. Run `netdom join` providing the following parameters.

> _Netdom requires a computer name right after the `join` parameter. If you’re using this command on other computers, replace the value with the variable `%computername%` to always represent the local computer._

```bash
netdom.exe join %computername% /domain:DomainName /UserD:DomainName\UserName /PasswordD:Password
```

![Netdom command output](https://adamtheautomator.com/wp-content/uploads/2021/04/Untitled-2021-04-07T103624.426.png)

Netdom command output

3\. Now restart the computer and the computer will be joined to the domain.

## Adding a Local Computer 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 can use PowerShell to add a computer to a domain.

Assuming you’re on a Windows 10 workgroup computer that can access an existing domain controller:

1\. Open up Windows PowerShell ensuring you run it as administrator.

Related:[How to Run PowerShell as Administrator](https://adamtheautomator.com/powershell-run-as-administrator/)

In the PowerShell console, run the [`Add-Computer`](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/add-computer?view=powershell-5.1) cmdlet. This cmdlet performs the same action as adding a computer to a domain via the GUI. Specify the domain name to add the computer to with the `DomainName` parameter and optionally specify the `Restart` parameter to restart the computer when complete automatically.

> _You can also specify the `Credential` parameter to specify the username and password sooner. See [this article](https://adamtheautomator.com/powershell-get-credential/) for more information. If you’d like to add a computer to a different OU upon creation, specify the `OUPath` parameter. For more options, run `[Get-Help](https://adamtheautomator.com/powershell-get-help/ "Get-Help") Add-Computer -Full`._

```powershell
Add-Computer -DomainName DomainName -Restart
```

![Add-Computer cmdlet credentials prompt](https://adamtheautomator.com/wp-content/uploads/2021/04/Untitled-2021-04-07T103856.153.png)

Add-Computer cmdlet credentials prompt

> _In PowerShell 7.x, the `Add-Computer` cmdlet is not available. To import this module into PowerShell 7.x you can use `Import-Module Microsoft.PowerShell.Management -UseWindowsPowerShell -WarningAction SilentlyContinue`, which will use Windows Powershell 5.1 in the background to run this command in your current PS 7.x session._

## Add a Local Computer to a Domain Via WMI

To ensure this tutorial covers _all_ ways you can add a computer to a domain, let’s continue with a lesser-known method of using [Windows Management Instrumentation (WMI)](https://docs.microsoft.com/en-us/windows/win32/wmisdk/wmi-start-page). WMI is a ubiquitous part of Windows that contains loads of information about a PC and can perform actions on it.

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

You can invoke WMI methods in many different ways. For this tutorial, let’s focus on two ways using the \*[wmic\* command-line utility](https://support.microsoft.com/en-us/topic/a-description-of-the-windows-management-instrumentation-wmi-command-line-utility-wmic-exe-f5c16751-3a83-49ee-030d-5092ce1a04bb) and PowerShell.

### Using WMIC

To add a computer to a domain with WMIC:

1\. Open a command prompt (cmd.exe) as administrator.

2\. 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 [appropriate bitwise operators](https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/joindomainorworkgroup-method-in-class-win32-computersystem) to join 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="secret"`)

```bash
wmic computersystem where name="%computername%" call joindomainorworkgroup fjoinoptions=3 name="homelab.local" username="homelab\labadmin" Password="secret"
```

![WMIC command output](https://adamtheautomator.com/wp-content/uploads/2021/04/Untitled-2021-04-07T104240.302.png)

WMIC command output

3\. When completed, restart the computer.

### Using PowerShell’s `Get-WmiObject` Cmdlet

You can also invoke the [`JoinDomainOrWorkgroup` WMI method](https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/joindomainorworkgroup-method-in-class-win32-computersystem) using PowerShell. To do so:

1\. Open PowerShell as administrator.

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

```powershell
(Get-WMIObject -NameSpace "Root\Cimv2" -Class "Win32_ComputerSystem").JoinDomainOrWorkgroup("homelab.local","secret","homelab\labadmin",$null,3)
```

![Get-WMIObject command output](https://adamtheautomator.com/wp-content/uploads/2021/04/Untitled-2021-04-07T104533.879.png)

Get-WMIObject command output

3\. When completed, restart the computer.

## Adding Computers Remotely to a Domain

Throughout this tutorial, you’ve learned how to add a computer to a domain as you’re sitting in front of that actual computer. But what happens when you can’t sit in front of that computer, or you have many computers to add? In that case, PowerShell is your best friend.

To add 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 `Get-WmiObject` cmdlet or use PSRemoting.

Related:[PowerShell Remoting: The Ultimate Guide](https://adamtheautomator.com/psremoting/)

To join remote computers to domain remotely, invoke the `Add-Computer` PowerShell cmdlet. But this time, use the `ComputerName` parameter.

> _To run the `Add-Computer` cmdlet remotely, you must ensure that [PSRemoting is enabled](https://adamtheautomator.com/enable-psremoting/) on all remote computers._

1\. On your local workstation (not the computer to add to a domain), open PowerShell as administrator.

2\. Run the below command. This command:

*   Adds the remote computer called _win10demo_ (`-ComputerName win10demo`) to the _homelab.local_ domain (`-DomainName homelab.local`).
*   Uses the _user01_ local user on _win10demo_ to authenticate to the remote computer (`-LocalCredential win10demo\user01`)
*   Uses the _labadmin_ domain account to authenticate to the domain to add the computer account (`-Credential homelab\labadmin`).
*   Will restart the computer automatically after it completes (`-Restart`)

```powershell
Add-Computer -ComputerName win10demo -LocalCredential win10demo\user01 -DomainName homelab.local -Credential homelab\labadmin -Restart
```

> _In PowerShell 7.x, the `Add-Computer` cmdlet is not available. To import this module into PowerShell 7.x you can use `Import-Module Microsoft.PowerShell.Management -UseWindowsPowerShell -WarningAction SilentlyContinue`, which will use Windows Powershell 5.1 in the background to run this command in your current PS 7.x session._

Once invoked, the `Add-Computer` cmdlet will then prompt you for passwords for the _user01_ and _labadmin_ accounts. When complete, PowerShell will restart the remote computer automatically.

> _By default, the `Add-Computer` cmdlet will not restart the remote computer if a user is logged in. To override this, specify the `Force` switch parameter to always to restart the remote computer._

## Confirming Creation of the AD Computer Account

When a computer is added to a domain, it creates a computer object. To ensure the computer created the computer object as expected, let’s open Active Directory Users and Computers (ADUC) to confirm.

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

Related:[How to Install and Import the Active Directory Module](https://adamtheautomator.com/powershell-import-active-directory/)

2\. In ADUC, expand the domain name node (_homelab.local_ in this case) and click on the **Computers** container. You should see the computer object added in the previous section.

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

![Active Directory Users and Computers snapin](https://adamtheautomator.com/wp-content/uploads/2021/04/Untitled-2021-04-07T105103.656.png)

Active Directory Users and Computers snapin

3\. Back on the Windows 10 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](https://adamtheautomator.com/wp-content/uploads/2021/04/Untitled-2021-04-07T105227.246.png)

Login as Other user option post domain joined

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

![Domain name while logging in](https://adamtheautomator.com/wp-content/uploads/2021/04/Untitled-2021-04-07T105342.552.png)

Domain name while logging in

> _Use the free Specops Password Auditor tool to scan your Active Directory and identify password-related vulnerabilities, including over 930 million known compromised passwords. [Download Today!](https://specopssoft.com/product/specops-password-auditor/?utm_source=ata&utm_medium=referral&utm_campaign=na_2023_ata&utm_content=mention)_

## Conclusion

Throughout this article, you’ve seen multiple ways to add computers to an AD domain. Each method has advantages and disadvantages, but you should now have all of the options in front of you.

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

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fadd-computer-to-domain%2F&text=How%20to%20Add%20a%20Computer%20to%20a%20Domain%20\(GUI%20and%20PowerShell\))[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fadd-computer-to-domain%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fadd-computer-to-domain%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2026/05/featured_image-11.webp)

### [How to Troubleshoot Active Directory Replication Errors](/troubleshoot-active-directory-replication-errors/)

Troubleshoot Active Directory replication errors by isolating 1311, 1722, 2087, and USN rollback issues with repadmin, dcdiag, DNS, RPC, and KCC checks.

![](https://adamtheautomator.com/wp-content/uploads/2026/05/featured_image-7.webp)

### [Migrate Group Policy to Intune Without Breaking Endpoints](/gpo-intune-migration/)

Export GPOs as XML, analyze them with Group Policy Analytics, migrate supported settings to Intune Settings Catalog, and resolve hybrid device conflicts.

![](https://adamtheautomator.com/wp-content/uploads/2026/06/ditch-gpos-intune-featured.webp)

### [Ditch the GPOs: Migrate to Microsoft Intune](/ditch-gpos-migrate-microsoft-intune-2/)

Use Group Policy Analytics to migrate GPOs to Intune Settings Catalog profiles, handle unsupported Group Policy Preferences, and manage hybrid AD-to-MDM transitions.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
