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
— the DNS Server field must show the DC’s IP, not 8.8.8.8.ipconfig /all
- Network connectivity to the DC: Ping the DC by IP and by FQDN. Test DNS:
must return the DC’s IP.nslookup contoso.com
- 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
, press Entersysdm.cpl
- Click the Computer Name tab, then click Change
- Select Domain, enter your domain FQDN (e.g.
), click OKcontoso.com
- 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
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
| Error | Cause | Fix |
|---|---|---|
| “The network path was not found” | DNS not pointing to DC | Set DNS to DC IP. Test:
nslookup contoso.com |
| “Domain does not exist or could not be contacted” | DNS resolution failure | Ensure DC DNS service is running; check firewall |
| “Access is denied” | Insufficient join permissions | Use Domain Admin credentials or increase MachineAccountQuota |
| “The account already exists” | Stale computer account in AD | Delete old computer account in ADUC, then retry |
| Kerberos time skew error | Clock more than 5 minutes off DC |
w32tm /resync /force |
| Firewall blocking join | AD ports blocked | Open ports 88, 135, 389, 445, 464, 3268 to DC |
Required Firewall Ports
| Port | Protocol | Service |
|---|---|---|
| 88 | TCP/UDP | Kerberos |
| 135 | TCP | RPC Endpoint Mapper |
| 389 | TCP/UDP | LDAP |
| 445 | TCP | SMB / NetLogon |
| 464 | TCP/UDP | Kerberos password change |
| 3268 | TCP | Global Catalog |
| 49152-65535 | TCP | RPC 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
-OUPath