Use it when a Windows computer cannot join an AD domain or a join appears to succeed but domain trust/secure-channel behavior is broken.
Domain Join Problems
Domain Join Problems covers discovery and validation of an AD domain, DNS/DC Locator, time/network reachability, credentials/permissions, computer-account state and secure-channel establishment.
1. DNS points to AD DNS; nltest /dsgetdc:<domain>.
2. Ports to DC open.
3. Account permissions to join/OU.
4. Existing computer account conflicts.
5. netsetup.log (C:\Windows\debug\netsetup.log).
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
dsregcmd /statusPrimary Commands
Configuration and operational commands for this Topic.
dsregcmd /statusReferenceShows whether the device is domain joined, Microsoft Entra joined or hybrid joined, and its SSO token state.
Use when: Single sign-on to Microsoft 365 fails, or a device is "Pending" in Microsoft Entra ID.
Quick note: Run it in the user's context to see the PRT state. The Diagnostic Data section shows the last join error.
Windows / Windows Server / PowerShell · state · verifiesTest-ComputerSecureChannelTroubleshootTests the trust between the local computer and its domain. Returns True or False.
Use when: A computer shows "The trust relationship between this workstation and the primary domain failed".
Quick note: Without -Repair the command only tests. -Repair -Credential <admin> resets the machine password.
Windows / Windows Server / PowerShell · control plane · verifiesVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Checks before and during join Verify boundary
Resolve-DnsName _ldap._tcp.dc._msdcs.example.com -Type SRV
nltest /dsgetdc:example.com
Test-NetConnection dc01.example.com -Port 389
Add-Computer -DomainName example.com -OUPath "OU=Workstations,DC=example,DC=com" -Credential EXAMPLE\joiner -Restart
Documented example, not captured output. Most failures are DNS (client using public DNS instead of the DC), blocked ports (53, 88, 135, 389, 445, 464, dynamic RPC), time skew, or a computer account that already exists. Log: C:\Windows\debug\NetSetup.LOG.
Step 2 Troubleshooting path Verify boundary
Client DNS/time → DC Locator → selected DC → join authorization → computer object → machine password/secure channel → reboot/member operation
Step 3 Common mistakes Narrow the fault
- Pre-existing computer account with wrong permissions.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- A DC being reachable does not prove DC Locator selected the right service, credentials are authorized, the computer object is usable or the secure channel is healthy.
- Keep the symptom, observed state and inferred cause as separate statements.
- Prefer evidence from the first failed boundary over broad configuration changes.
- A successful local check does not automatically prove the next dependency or end-to-end workload.
Get-WinEvent -FilterHashtable @{LogName='System';Level=1,2;StartTime=(Get-Date).AddHours(-24)}— system errors last 24hGet-WinEvent -FilterHashtable @{LogName='Application';Level=1,2;StartTime=(Get-Date).AddHours(-24)}— application errorsGet-ComputerInfo -Property OsName,OsBuildNumber,CsDomain— system contextGet-HotFix | Sort InstalledOn -Desc | Select -First 5— recent updates
ReferenceImportant terms & boundaries3 sections · depth on demand
What the evidence shows
A DC being reachable does not show DC Locator selected the right service, credentials are authorized, the computer object is usable or the secure channel is healthy.
In depth
NetSetup.log is the primary evidence
Every join attempt is logged in C:\Windows\debug\NetSetup.log, which Microsoft's domain-join troubleshooting article uses for analysis:
C:\> findstr /i "NetpJoinDomain NetpLdap NetpDsGetDcName error status" C:\Windows\debug\NetSetup.log
NetpDsGetDcName: failed to find a DC in the specified domain: 0x54b, last error is 0x0
NetpJoinDomainOnDs: Function exits with status of: 0x54b
| Status | Meaning | Check |
|---|---|---|
| 0x54b (1355) | Domain does not exist or cannot be contacted | Client DNS → AD DNS; SRV records |
| 0x52e (1326) | Bad user name or password | Join account credentials |
| 0x8b0 (2224) | Account already exists | Pre-staged object; permission to reuse it |
| 0x569 (1385) | Logon type not granted | GPO "Access this computer from the network" |
| 0x40 (64) / 0x3a (58) | Network name no longer available / server cannot perform | SMB to the DC blocked, SMB signing or version mismatch |
| 0x21c4 (8644) / quota | Machine account quota exceeded | ms-DS-MachineAccountQuota or delegated OU rights |
Pre-join checks from the client
Resolve-DnsName _ldap._tcp.dc._msdcs.corp.example.com -Type SRV
nltest /dsgetdc:corp.example.com
'53','88','135','389','445','464' | % { Test-NetConnection dc01.corp.example.com -Port $_ -InformationLevel Quiet }
w32tm /stripchart /computer:dc01.corp.example.com /samples:3 /dataonly
Reusing computer names safely
Since the 2022 hardening (KB5020276), reusing an existing computer account is blocked unless the joining user created it, is a domain admin, or the account owner is trusted by policy. Delete the old object, or pre-stage the account with the right owner/rights, instead of weakening the protection.
After the join
| Check | Command |
|---|---|
| Secure channel | Test-ComputerSecureChannel -Verbose |
| Correct OU | Get-ADComputer pc042 \| Select DistinguishedName |
| GPOs applied | gpresult /scope computer /r |
| DNS registration | Resolve-DnsName pc042.corp.example.com |
*The domain join NetSetup.log entries above are illustrative examples, not captured from a lab or production system.*
Method
Domain join problems:
| Error | Cause |
|---|---|
| "An Active Directory Domain Controller could not be contacted" | Client DNS not pointing to AD DNS |
| "The specified domain either does not exist" | DNS/firewall (LDAP 389, Kerberos 88, SMB 445, RPC) |
| "Account already exists" | Pre-staged/duplicate computer object; reuse needs rights |
| "Machine quota exceeded" | ms-DS-MachineAccountQuota reached — use delegated join account |
| Access denied | Join account lacks rights on target OU |
Add-Computer -DomainName corp.example.com -OUPath 'OU=Workstations,OU=Corp,DC=corp,DC=example,DC=com' -Credential CORP\join-svc -Restart
nltest /dsgetdc:corp.example.com
Get-Content $env:windir\debug\NetSetup.LOG -Tail 50
NetSetup.LOG has the exact failure step.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Windows Troubleshooting → Domain Join Problems. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/troubleshoot/windows/ · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Windows Troubleshooting → Domain Join Problems reference map
Fast troubleshooting boundaries for Windows Troubleshooting → Domain Join Problems.
| Boundary | Meaning | Evidence limit |
|---|---|---|
| Symptom | What the user/workload reports | Starting point, not root cause |
| Local state | What Windows reports at this boundary | Does not prove adjacent dependency |
| Correlated evidence | Multiple sources agree in one timeline | Strengthens hypothesis, not automatic causation |
| Verification | Original test succeeds after controlled change | Required to close the troubleshooting loop |