Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Active Directory / Join Windows Computer to Active Directory Domain: Step-by-Step Guide

August 12, 2026

Join Windows Computer to Active Directory Domain: Step-by-Step Guide

In this article, we’ll cover several ways to join a Windows computer to an existing on-premises Active Directory domain. We’ll demonstrate how to perform the domain join through the graphical Windows Settings/Control Panel interface, from the command line using netdom or djoin, and with PowerShell (which is generally the fastest and simplest method for joining a computer to a domain).

The methods described in this article are applicable to all supported Windows versions, including recent builds of Windows 11 and Windows Server 2025, 2022, 2019, and 2016.

Contents:
  • Active Directory Domain Join Prerequisites for Windows
  • Add Windows to a Domain via the System Properties GUI
  • Join a Windows PC to a Domain via the Settings App
  • How to Join a Computer to a Domain Using PowerShell
  • Pre-staging Computer Accounts in Active Directory
  • How to Perform an Offline Domain Join in Active Directory

Active Directory Domain Join Prerequisites for Windows

First, let’s take a look at the basic requirements and preparatory steps you need to take on your computer before joining an Active Directory domain

  • Supported Windows editions. Make sure that your computer is running one of the following Windows editions: Pro, Education, Pro for Workstations, or Enterprise. The Windows Home and Single Language editions do not support the option of joining an Active Directory domain.
  • Network connectivity. Your device must be connected to a local network with access to at least one Active Directory domain controller. The computer must be configured to use an IP address from the corporate network range with the IP address of the nearest domain controller specified in the computer’s primary DNS settings (the network adapter settings can be configured either manually or via the DHCP server).
  • Domain controller and DNS availability. Make sure that your computer can resolve the domain name and can access the domain controller: ping woshub.loc use ping to check domain controller connectivityYour corporate firewalls should not block the standard AD network ports.
  • Time Synchronization. The computer’s local time must be within five minutes of the domain controller’s time. Proper time synchronization is required for Kerberos authentication (time in a domain is usually configured to synchronize with an external NTP source).
  • Set the unique computer name (hostname) to be used in a domain. By default, Windows generates a random computer name during installation. However, it’s best to change it to something more meaningful. You can change the computer name using the classic Control Panel sysdm.cpl . Click Change, enter a new computer name, and press OK. As you can see, the computer is currently a member of the default WORKGROUP. Change Windows hostname (computer name)
    Or use this PowerShell command to change the computer hostname:Rename-Computer -NewName "wks-tst1"Restart Windows once you have changed the hostname.renam-computer with powershell
  • Active Directory domain join permissions. You need a domain account with permissions to add new computers to the domain. These permissions are granted to domain administrators by default and can be delegated to other users. Additionally, any non-privileged domain user can join up to ten computers to the domain (this is configured via the AD attribute ms-DS-MachineAccountQuota)
  • Unique Machine local SID. When deploying a preconfigured Windows image (gold image) to workstations, it is essential to use the sysprep tool when capturing the image. Starting in 2025, Microsoft has tightened the requirements for the uniqueness of local computer SIDs and is blocking mutual authentication between computers with duplicate Security Identifiers.

Add Windows to a Domain via the System Properties GUI

You can add your computer to the domain via the System Properties applet in the classic Windows Control Panel. It can be found in the modern Settings app under System -> About -> Domain or Workgroup, by pressing the Win+Pause/Break hotkey, or by running the command sysdm.cpl .

windows 11 join domain via system properties dialog

  1. In the System Properties, click the Change button on the Computer Name tab.
  2. Switch the Member of option to ‘Domain’ and specify the name of your Active Directory domain.join domain via system properties
  3. You will be prompted to enter the name and password of a domain user.  Enter the credentials of a user who has permission to join computers to the domain. user credential to join active directory
  4. The next thing you should see is the message Welcome to the woshub.loc domain; Welcome to the domain
  5. Restart your computer.

When a computer joins a domain, a new account is created for it using its hostname. Open the AD Users and Computers snap-in by running dsa.msc, and then navigate to the root container CN=Computers. By default, new computer accounts are created in this container, but you can change the default OU for new computers.

aduc default container for new computer accounts

If you cannot add a computer to the domain due to an error, a detailed log of the process is stored on the client in the %windir%\debug\netsetup.log file, which is useful for troubleshooting.

The netsetup.log file can be used to track who added the computer to the domain, when it was added, and the computer name it was added under. If the hostname has been changed, this file can be used to find out the previous computer name.

netsetup.log contains domain join logs

To join a Windows Server 2025/2022/2019/2019 computer to an AD domain, access the System Properties dialog box from the Server Manager -> Local Server -> Domain.

windows server manager join domain

On Windows Server Core, you can use the sconfig tool to join a host to a domain. See the article on how to configure the Server Core from the command prompt.

After the computer restarts, the domain Group Policies will be applied to your computer, nd you can sign in to the computer using your domain user account.

Join a Windows PC to a Domain via the Settings App

In Windows 11, you can join a computer to an AD domain through the modern Settings app. The steps below are for the latest Windows 11 25H2 build.

  1. Go to Settings -> Accounts -> Access work or school -> and click Connect (to quickly navigate to this section, run the following URI shortcut command: ms-settings:workplace).
  2. Click the link below: Alternate actions: Join this device to a local Active Directory domain.Windows Settings app -> Join this device to a local Active Directory domain
    If your computer has already been added to the domain, you will see a notification, “Connected to WOSHUB AD domain“. Windows device connected to AD domain
  3. Enter the domain name; specify an AD domain name to join
  4. Then specify domain user credentials.
  5. Skip the next step of adding the user to the local Administrators group (it is preferable to add domain users to the local Admins via GPO).
  6. It remains to restart Windows to complete joining the domain.restart your PC to compleate domain join

How to Join a Computer to a Domain Using PowerShell

You can use the built-in Add-Computer PowerShell cmdlet to join computers to an Active Directory domain. This command also allows you to join a domain with a new hostname and immediately move the computer’s account to a specific OU.

How can you check whether a computer is currently in a domain or a workgroup? Run:
(Get-CimInstance Win32_ComputerSystem).Domain

Use PowerShell to check if a computer is in a domain or a workgroup

If the command returned the workgroup name, you can proceed with joining this machine to the domain. In the simplest case, adding a computer to a domain requires only specifying the target domain name.

Add-Computer -DomainName woshub.loc

Enter the domain user credentials with the permissions to join machines to the domain.

Add-Computer - join computer to a domain

You can immediately place a computer into a specific Organizational Unit (OU) during a domain join, instead of the default root CN=Computers container. Just specify the target OU name in the distinguished name (DN) format in the -OUPath parameter:

$OU ="OU=Computers,OU=Munich,DC=woshub,DC=loc"
Add-Computer -DomainName woshub.loc -OUPath $OU -Restart

Add the -Restart option to restart Windows immediately after joining the domain.

PowerShell: Adding a computer to a Delegated OU

Once the system has been restarted, you can verify that your computer is now a member of the Windows domain by running the command:

Get-WmiObject Win32_NTDomain

This command should return the domain name, AD site name, IP address, and domain controller name used to log on (Logon server).

Get-WmiObject Win32_NTDomain - view domain info on a computer

You can also get your domain name with the command:

systeminfo | findstr /B "Domain"

systeminfo | findstr domain

The Add-Computer cmdlet can be used to join remote computers to the domain. To do this, specify the remote computer name in the -ComputerName parameter:

Add-Computer -ComputerName wks-mn14 -DomainName woshub.loc -Credential woshub\Administrator -LocalCredential wks-mn14\Admin -Restart –Force

This requires that the WinRM service is enabled and configured on the remote computer. Learn more about how to configure WinRM for PowerShell remoting on computers in a workgroup environment.

Note that the Add-Computer command is missing from the built-in Microsoft.PowerShell.Management module in the new versions of PowerShell Core 7.x.

Add-Computer: The term 'Add-Computer' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Suggestion [4,General]: The most similar commands are: Add-Computer, Stop-Computer, Get-ADComputer, New-ADComputer, Set-ADComputer, Add-Content, Rename-Computer, Add-Member.

Therefore, use powershell.exe instead of pwsh.exe to add a computer to the domain in this case. For example:

powershell.exe -Command "Add-Computer -DomainName 'woshub.loc' -Restart"

You can also use the netdom.exe command to join a Windows computer to a domain. However, it requires the installation of the RSAT administration tools on the client’s computer and is now very rarely used. This legacy tool is mainly used for compatibility in some old scripts.  Here’s an example of the netdom command to join a machine to the domain:

netdom join %computername% /domain:woshub.loc /UserD:woshub\admin /PasswordD:*

The user’s password is prompted interactively and is not saved in the command history.

To remove a computer from an Active Directory (i.e. leave the domain) and return it to a workgroup, run the following PowerShell command

Remove-Computer

After you leave the domain, you will need to know the password of the local Administrator account to log onto this computer. Do you wish to continue?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y

Remove-Computer from AD

Pre-staging Computer Accounts in Active Directory

By default, when you join new computers to a domain, they are placed in the built-in Computers container at the domain root. To manually move a machine account to a different OU (Organizational Unit), you can either drag and drop it or use the Move menu item.

move ad computer object to another ou

An administrator can pre-stage a computer account in Active Directory using either the Active Directory Users and Computers dsa.msc snap-in (New -> Computer) or with the New-ADComputer cmdlet from the ActiveDirectory PowerShell module:

New-ADComputer -Name "wks-mn14" -SamAccountName "wks-mn14" -Path "OU=Computers,OU=Munich,DC=woshub,DC=loc"

If you are creating a computer account manually, make sure that the name you specify matches the computer’s hostname.

We recommend that you first perform an AD search for other computers with the same name. If a computer with this hostname already exists in AD and you want to assign it to a different machine, a solution would be to reset it. Right-click on the computer object in AD and select Reset Account.

Reset computer account in Active Directroy

One more way to reset a computer account in AD is to use PowerShell

Get-ADComputer -Identity "computername" | % {dsmod computer $_.distinguishedName -reset}

This resets the domain computer password used to establish a trust relationship with AD.

A new security measure called Netjoin Domain Join Hardening was rolled out via Windows Update from October 2022 onwards.  This security change prevents existing (pre- staged) computer accounts in the AD domain from being reused during domain join, unless strict conditions are met.

When attempting to join a computer to a domain using an existing account, the following error will appear:

NERR_AccountReuseBlockedByPolicy:
An account with the same name exists in Active Directory. Re-using the account was blocked by security policy.

Read this post to learn more about the new restrictions and workarounds.

How to Perform an Offline Domain Join in Active Directory

Another way to add a Windows computer to an AD domain is through Offline Domain Join. It allows a computer to join a domain without directly connecting to domain controllers.

First, the administrator creates (provisions) a computer account on a domain controller for the machine that will join the domain and generates a special encrypted metadata file (blob).

djoin /provision /domain woshub.loc /machine WKS123 /savefile WKS123djoin.txt

djoin offline domain join

This file is transferred to the target disconnected computer using external media, the cloud, or the internet.  After that, the target computer is joined to the domain (even without any network connection).

djoin /requestodj /loadfile WKS123djoin.txt /windowspath c:\windows /localos

djoin requestobj loadfile

After rebooting, the computer considers itself part of the domain and can fully authenticate to the domain once it connects to the corporate network.

In practice, the offline domain join process is rarely used nowadays. The main scenarios are: adding new employee devices to the domain before the corporate VPN is configured (as an alternative to starting the VPN before logging into Windows), devices on high-latency channels, and devices in isolated or DMZ segments where some ports to the domain controller are blocked by a firewall.

And finally, you can implement a scenario for automatic domain join during OS deployment.  To do this, you can create an unattend.xml file with the Microsoft-Windows-UnattendedJoin option configured. This answer file can be generated using the Windows System Image Manager, which is part of the Windows ADK.

Microsoft-Windows-UnattendedJoin - generate unattend.xml

0 comment
4
Facebook Twitter Google + Pinterest
Active DirectoryQuestions and AnswersWindows 10Windows 11Windows Server 2025
previous post
Using Previous Command History in PowerShell Console
next post
Disable Built-in PDF Viewer in Microsoft Edge

Related Reading

Refresh AD Groups Membership without Reboot/Logoff

March 15, 2024

How to Find the Source of Account Lockouts...

March 12, 2024

Allow Non-admin Users RDP Access to Windows Server

March 16, 2024

Configuring Windows Firewall Rules Using Group Policy

March 15, 2024

Copy Files and Folders to User Computers via...

March 15, 2024

How to Disable NTLM Authentication in Windows Domain

March 16, 2024

Configure Windows LAPS (Local Administrator Passwords Solution) in...

March 15, 2024

How to Install the PowerShell Active Directory Module...

March 24, 2026

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • How to Hide Wi-Fi Network in Windows with WLAN Filters (Blacklist and Whitelist)

    August 14, 2026
  • Invalid Signature Detected: Check Secure Boot Policy [Fix]

    August 5, 2026
  • Windows Installer Service Could Not Be Accessed? How to Fix It

    July 28, 2026
  • Why Windows Reports No Internet Access: How Connectivity Detection Works

    July 26, 2026
  • Inactive TS Ports in Windows: Causes and Fixes

    July 20, 2026
  • Add Wireless Wi-Fi Profiles on Windows Devices via Export/Import or GPO

    July 13, 2026
  • CrowdSec on Windows: From Installation to Threat Blocking

    July 3, 2026
  • Manage Microsoft Store Apps with Store CLI in Windows 11 from Terminal

    July 2, 2026
  • Windows Sandbox on Windows 11: Enable, Configure, and Use

    June 10, 2026
  • How to Monitor Windows Machines with Zabbix

    May 26, 2026

Follow us

  • Facebook
  • Twitter
  • Youtube
  • Telegram
Popular Posts
  • Configure Google Chrome Settings with Group Policy
  • Allow Non-admin Users RDP Access to Windows Server
  • How to Find the Source of Account Lockouts in Active Directory
  • How to Disable or Enable USB Drives in Windows using Group Policy
  • Get-ADComputer: Find Computer Properties in Active Directory with PowerShell
  • Adding Domain Users to Local Administrators in Windows
  • Configure Windows LAPS (Local Administrator Passwords Solution) in AD
Footer Logo

@2014 - 2026 - Windows OS Hub. All about operating systems for sysadmins


Back To Top