How to Join a Windows Server to an Active Directory Domain (GUI + PowerShell)

Joining a Windows Server to an Active Directory domain is one of the most fundamental tasks in a Windows Server environment. This guide covers both the GUI method and the PowerShell method, prerequisites, common errors and fixes, and post-join tasks to complete before putting the server into production.

Prerequisites

  • DNS points to the Domain Controller: The server’s DNS must point to an AD-integrated DNS server (the DC’s IP). Check via
    ipconfig /all
    — the DNS Server field must show the DC’s IP, not 8.8.8.8.
  • Network connectivity to the DC: Ping the DC by IP and by FQDN. Test DNS:
    nslookup contoso.com
    must return the DC’s IP.
  • Time synchronization: Kerberos requires clocks within 5 minutes of each other. Check with
    w32tm /query /status
    .
  • Valid credentials: A domain account with permission to join computers. Domain Admins always work; regular users can join up to 10 machines by default.
  • Unique computer name: The server hostname must be unique in the domain.

Method 1: GUI (System Properties)

  • Press Win + R, type
    sysdm.cpl
    , press Enter
  • Click the Computer Name tab, then click Change
  • Select Domain, enter your domain FQDN (e.g.
    contoso.com
    ), click OK
  • Enter domain credentials when prompted
  • Restart the server — the join is not complete until after restart

Method 2: PowerShell (Add-Computer)

Basic domain join


Add-Computer -DomainName "contoso.com" -Credential (Get-Credential) -Restart

Join and place in a specific OU


Add-Computer `
  -DomainName "contoso.com" `
  -OUPath "OU=Servers,OU=IT,DC=contoso,DC=com" `
  -Credential (Get-Credential) `
  -Restart

Using

-OUPath
places the computer account directly into the correct OU, ensuring GPOs apply immediately after the first reboot. This is the recommended approach for production servers.

Join without immediate restart


Add-Computer -DomainName "contoso.com" -Credential (Get-Credential) -PassThru -Verbose
Restart-Computer -Force

Verifying the Domain Join


(Get-WmiObject Win32_ComputerSystem).Domain
# Expected output: contoso.com

nltest /dsgetdc:contoso.com

Common Errors and Fixes

ErrorCauseFix
“The network path was not found”DNS not pointing to DCSet DNS to DC IP. Test:
nslookup contoso.com
“Domain does not exist or could not be contacted”DNS resolution failureEnsure DC DNS service is running; check firewall
“Access is denied”Insufficient join permissionsUse Domain Admin credentials or increase MachineAccountQuota
“The account already exists”Stale computer account in ADDelete old computer account in ADUC, then retry
Kerberos time skew errorClock more than 5 minutes off DC
w32tm /resync /force
Firewall blocking joinAD ports blockedOpen ports 88, 135, 389, 445, 464, 3268 to DC

Required Firewall Ports

PortProtocolService
88TCP/UDPKerberos
135TCPRPC Endpoint Mapper
389TCP/UDPLDAP
445TCPSMB / NetLogon
464TCP/UDPKerberos password change
3268TCPGlobal Catalog
49152-65535TCPRPC dynamic ports

Post-Join Tasks

  • Move to correct OU (if -OUPath was not used): In ADUC, right-click the computer account in CN=Computers → Move to the appropriate OU
  • Run gpupdate:
    gpupdate /force
  • Verify GPO application:
    gpresult /r
  • Test domain authentication: Log on with a domain account
  • Set a static IP if not already done — member servers should not use DHCP

Conclusion

Domain join is reliable when prerequisites are met — especially DNS pointing to the DC and correct system time. The PowerShell

Add-Computer
method with
-OUPath
is the cleaner approach for production environments as it places the computer in the correct OU immediately. Always verify domain membership and GPO application after the join before putting the server into production.

Scroll to Top