Entra IDDeep dive

Entra hybrid join and device registration error codes: dsregcmd, DSREG and 0x801C

Every documented Entra hybrid join and device registration code from dsregcmd /status and the event logs, by phase: discovery, authentication, join and PRT, with cause and first check.

When a Windows device won't finish Microsoft Entra hybrid join, or joins but never gets a Primary Refresh Token (PRT), Windows records the reason in three places: the Diagnostic Data block of dsregcmd /status, the User Device Registration Admin log and the AAD logs. This quick reference lists the codes Microsoft documents for them, grouped by the phase where things stopped, with the meaning, the usual cause and the first check.

Codes in this quick reference

  • AD Connectivity Test : FAIL: no line of sight to a domain controller (pre-check)dsregcmd /status (Diagnostic Data)
  • AD Configuration Test : FAIL: the service connection point can't be read or is wrongdsregcmd /status (Diagnostic Data)
  • DRS Discovery Test : FAIL [code/sub-code]: discovery or user realm request faileddsregcmd /status (Diagnostic Data)
  • DRS Connectivity Test : FAIL: no connection to the device registration servicedsregcmd /status (Diagnostic Data)
  • Token acquisition Test : FAIL: no Entra token for a federated joindsregcmd /status (Diagnostic Data)
  • DeviceAuthStatus : ERROR: the device health check couldn't rundsregcmd /status (Device Details)
  • AadRecoveryEnabled : YES: device keys unusable, device marked for recoverydsregcmd /status (Diagnostic Data)
  • KeySignTest: : MUST Run elevated to test.dsregcmd /status (Device State)

+ 45 more codes in the tables below.

How this guide is organized: How to read these codes → dsregcmd fields that point at the problem → Discover phase → Authentication phase → Join phase → After the join → Event IDs to search for → How to verify a fixFlow diagram of the article's sections in reading order: 1. How to read these codes. 2. dsregcmd fields that point at the problem. 3. Discover phase. 4. Authentication phase. 5. Join phase. 6. After the join. 7. Event IDs to search for. 8. How to verify a fix. Toolbox: 0x801C001D, 0x801C0021, 0x80072EE2, dsregcmd /status, whoami /upn.1How to read thesecodes2dsregcmd fields thatpoint at the problem3Discover phase4Authentication phase5Join phase6After the join7Event IDs to searchfor8How to verify a fixTOOLBOX0x801C001D0x801C00210x80072EE2dsregcmd /statuswhoami /upnHow this guide is organized: How to read these codes → dsregcmd fields that point at the problem → Discover phase → Authentication phase → Join phase → After the join → Event IDs to search for → How to verify a fixFlow diagram of the article's sections in reading order: 1. How to read these codes. 2. dsregcmd fields that point at the problem. 3. Discover phase. 4. Authentication phase. 5. Join phase. 6. After the join. 7. Event IDs to search for. 8. How to verify a fix. Toolbox: 0x801C001D, 0x801C0021, 0x80072EE2, dsregcmd /status, whoami /upn.1How to read these codes2dsregcmd fields that point at the problem3Discover phase4Authentication phase5Join phase6After the join7Event IDs to search for8How to verify a fixTOOLBOX0x801C001D0x801C00210x80072EE2dsregcmd /statuswhoami /upn
At a glance: how this guide is organized · 8 sections · 5 key settings and tools

How to read these codes#

Where to look for a hybrid join or PRT failureDoes dsregcmd /status show AzureAdJoined : YES? if Yes: Read Attempt Status under SSO State (Run dsregcmd /status as the user; see the PRT and CloudAP codes); if No: Is there a Diagnostic Data block in the elevated output? if No: Read User Device Registration › Admin (Windows 10 before version 1803 has no Diagnostic Data block); if Yes: Which Error Phase does it show? if Pre-check: Fix the failed pre-join test (For example AD Connectivity Test : FAIL means no line of sight to a DC); if Discover: Look up the code and its sub-error (A failed test can show two codes; the second names the real cause); if Auth or join: Use the authentication or join table (Auth is for federated domains only; join means the request reached DRS)Does dsregcmd /status showAzureAdJoined : YES?FIXRead AttemptStatus under SSOStateRun dsregcmd/status as the user;see the PRT andCloudAP codesYesIs there a Diagnostic Data blockin the elevated output?FIXRead User DeviceRegistration ›AdminWindows 10 beforeversion 1803 has noDiagnostic DatablockNoWhich Error Phase does itshow?FIXFix the failedpre-join testFor example ADConnectivity Test :FAIL means no lineof sight to a DCPre-checkFIXLook up the codeand its sub-errorA failed test canshow two codes; thesecond names thereal causeDiscoverFIXUse theauthentication orjoin tableAuth is for federateddomains only; joinmeans the requestreached DRSAuth or joinYesNoWhere to look for a hybrid join or PRT failureDoes dsregcmd /status show AzureAdJoined : YES? if Yes: Read Attempt Status under SSO State (Run dsregcmd /status as the user; see the PRT and CloudAP codes); if No: Is there a Diagnostic Data block in the elevated output? if No: Read User Device Registration › Admin (Windows 10 before version 1803 has no Diagnostic Data block); if Yes: Which Error Phase does it show? if Pre-check: Fix the failed pre-join test (For example AD Connectivity Test : FAIL means no line of sight to a DC); if Discover: Look up the code and its sub-error (A failed test can show two codes; the second names the real cause); if Auth or join: Use the authentication or join table (Auth is for federated domains only; join means the request reached DRS)Does dsregcmd /status show AzureAdJoined :YES?YesFIXRead Attempt Status under SSO StateRun dsregcmd /status as the user; see the PRT andCloudAP codesNoIs there a Diagnostic Data block in theelevated output?NoFIXRead User Device Registration › AdminWindows 10 before version 1803 has noDiagnostic Data blockYesWhich Error Phase does it show?Pre-checkFIXFix the failed pre-join testFor example AD Connectivity Test : FAILmeans no line of sight to a DCDiscoverFIXLook up the code and its sub-errorA failed test can show two codes; thesecond names the real causeAuth or joinFIXUse the authentication or join tableAuth is for federated domains only; joinmeans the request reached DRS
Figure 1 · Decision tree Where to look for a hybrid join or PRT failure. Run dsregcmd /status elevated, then answer the questions from the top; the Error Phase tells you which table below to use.
  • Run dsregcmd /status from an elevated prompt. The pre-join tests then run as SYSTEM, the same context as the real join. Run it again un-elevated as the user for User State and SSO State (the WAM fields can show an error when elevated).
  • Error Phase (pre-check, discover, auth or join) tells you which table to use. Client ErrorCode is the HRESULT; Server ErrorCode and Server Message appear only when the device registration service (DRS) answered.
  • A failed test can show two codes, such as DRS Discovery Test : FAIL [0x801c0021/0x80072ee2]: the second one is the sub-error that names the real cause.
  • Builds older than Windows 10 version 1803 have no Diagnostic Data block. Use Applications and Services Logs › Microsoft › Windows › User Device Registration › Admin instead.
  • After the join, PRT failures appear as Attempt Status under SSO State (Windows 10 version 21H1 and later) or in Microsoft › Windows › AAD: errors in Operational, informational events in Analytic (enable it with View › Show Analytic and Debug Logs).
PowerShell
dsregcmd /status
Get-WinEvent -FilterHashtable @{ LogName = 'Microsoft-Windows-User Device Registration/Admin'; Id = 201, 204, 220, 304, 305, 307 } -MaxEvents 20 |
    Format-List TimeCreated, Id, Message
Get-WinEvent -FilterHashtable @{ LogName = 'Microsoft-Windows-AAD/Operational'; Id = 1081, 1084, 1088 } -MaxEvents 20 |
    Format-List TimeCreated, Id, Message

Codes already explained in a full guide on this site link to it instead of repeating it. For the policy side of setup, see configuring hybrid join with an SCP.

dsregcmd fields that point at the problem#

CodeMeaningUsual causeFirst check
AD Connectivity Test : FAILNo connection to a domain controllerDevice off the internal network or VPNRestore line of sight to a DC; the join stops at pre-check until then
AD Configuration Test : FAILService connection point (SCP) unreadable or invalidSCP missing or misconfigured in the forestCheck the SCP; expect 0x801c001d in the discover phase
DRS Discovery Test : FAILDiscovery metadata or user realm request failedProxy, firewall or DNSLook up the sub-error in the next table
DRS Connectivity Test : FAILBasic connection to DRS failedenterpriseregistration.windows.net blocked for SYSTEMLet the computer account through the proxy
Token acquisition Test : FAILFederated tenants only: no Entra token for the joinFederation service or WS-Trust problemAuthentication-phase table; sync join is tried next
Fallback to Sync-Join not ENABLEDNo sync-join fallback after an authentication failureFallbackToSyncJoin = 0 under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CDJRemove the value (fallback is on by default) or fix federation
DeviceAuthStatus : ERRORThe device health check couldn't runNo connectivity to Entra ID as SYSTEMFix connectivity and rerun elevated
DeviceAuthStatus : FAILED. Device is either disabled or deletedDevice object disabled or deleted in Entra IDCleanup or stale-device policyGuide
AadRecoveryEnabled : YESDevice keys unusable; device marked for recoveryKey or TPM problemThe next sign-in re-registers it: silently for hybrid joined devices, with a prompt otherwise
KeySignTest: : MUST Run elevated to test.Key health test skippeddsregcmd ran un-elevatedRerun elevated; PASSED means healthy keys
Virtual Desktop : INVALIDVDI metadata present but set incorrectlyVDI provisioning metadataCompare the metadata dsregcmd prints with the vendor's settings
DomainJoined : YES but AzureAdJoined : NOJoin not finishedAny phase belowGuide
WorkplaceJoined : YES on a hybrid joined PCWork account added before the join completedDual stateGuide

Discover phase#

CodeMeaningUsual causeFirst check
0x801c001d DSREG_AUTOJOIN_ADCONFIG_READ_FAILEDSCP couldn't be read; no tenant informationMissing or wrong SCPGuide
0x801c0021 DSREG_AUTOJOIN_DISC_FAILEDGeneric discovery failureSee the sub-errorGuide
0x801c001f DSREG_AUTOJOIN_DISC_WAIT_TIMEOUTDiscovery timed outenterpriseregistration.windows.net unreachable as SYSTEMTest the endpoint in SYSTEM context
0x801c003d DSREG_AUTOJOIN_USERREALM_DISCOVERY_FAILEDRealm discovery failed: managed or federated unknownlogin.microsoftonline.com unreachable as SYSTEM (version 1809 and later)Read the sub-error; allow SYSTEM through the proxy
0x801c003a DSREG_DISCOVERY_TENANT_NOT_FOUNDTenant not foundWrong tenant ID in the SCP, or no active subscriptionCorrect the SCP's tenant ID
0x801c0025 DSREG_SERVER_BUSYHTTP 503 from DRSService temporarily unavailableNothing to fix; a later attempt usually works
0x8007000d E_INVALIDDATAResponse JSON couldn't be parsedProxy returned HTTP 200 with an HTML sign-in pageLet SYSTEM authenticate silently to the proxy
0x80072efd WININET_E_CANNOT_CONNECTConnection couldn't be establishedFirewall or proxyCheck the hybrid join network requirements
0x80072ee2 WININET_E_TIMEOUTNetwork timeoutFirewall or proxyGuide
0x80072f8f WININET_E_DECODING_FAILEDResponse couldn't be decodedProxy modifying the responseExclude Microsoft endpoints from inspection

Authentication phase (federated domains)#

Only federated domains reach this phase: Windows asks the federation service for a token with integrated Windows authentication against an active WS-Trust endpoint. Event 305 holds the code, sub-error and server error.

CodeMeaningUsual causeFirst check
0xcaa90017 ERROR_ADAL_PROTOCOL_NOT_SUPPORTEDProtocol isn't WS-TrustIdentity provider without WS-TrustThe on-premises provider must support WS-Trust
0xcaa9002c ERROR_ADAL_FAILED_TO_PARSE_XMLNo XML from the federation serviceBroken MEX endpoint or a proxy answeringConfirm MEX returns valid XML
0xcaa90023 ERROR_ADAL_COULDNOT_DISCOVER_USERNAME_PASSWORD_ENDPOINTNo username/password endpoint foundWS-Trust endpoints disabled or absent from MEXEnable them; recheck the MEX response
0xcaa82ee2 ERROR_ADAL_INTERNET_TIMEOUTNetwork timeoutEntra ID or the provider unreachable as SYSTEMTest both endpoints as SYSTEM
0xcaa82efe ERROR_ADAL_INTERNET_CONNECTION_ABORTEDConnection to the authorization endpoint abortedUnstable networkRetry later or from another network
0xcaa82f8f ERROR_ADAL_INTERNET_SECURE_FAILUREServer TLS certificate couldn't be validatedClock skew or interceptionCheck the client's time, then retry
0xcaa82efd ERROR_ADAL_INTERNET_CANNOT_CONNECTCouldn't connect to login.microsoftonline.comFirewall or proxyCheck that connection
0xcaa20003 ERROR_ADAL_SERVER_ERROR_INVALID_GRANTEntra ID didn't accept the on-premises SAML tokenFederation server settingsFind the server error in the authentication logs
0xcaa90014 ERROR_ADAL_WSTRUST_REQUEST_SECURITYTOKEN_FAILEDWS-Trust fault; no assertionFederation server settingsRead the server error code
0xcaa90006 ERROR_ADAL_WSTRUST_TOKEN_REQUEST_FAILToken endpoint returned an errorVariesFind the underlying error in the ADAL log
0xcaa1002d ERROR_ADAL_OPERATION_PENDINGGeneral ADAL failureVariesRead the sub-error or server error

Join phase#

The request reached DRS. Windows 10 version 1803 and later show Registration Type (sync for a sync join) with the server's answer; older builds log event 204.

CodeMeaningUsual causeFirst check
0x801c03f2 DSREG_E_DIRECTORY_FAILUREDRS answered DirectoryErrorSee the server messageGuide
0x801c0002 DSREG_E_DEVICE_AUTHENTICATION_ERRORDRS answered AuthenticationError (sub-code not DeviceNotFound)See the server messageUse the server rows below
0x801c0006 DSREG_E_DEVICE_INTERNALSERVICE_ERRORError response from DRSSee the server messageUse the server rows below
DirectoryError: Your request is throttled temporarily. Please try after 300 seconds.Federated join throttledSeveral registration requests in quick successionWait out the cool-down, then retry
DirectoryError: AADSTS90002: Tenant UUID not found.Sync join can't find the tenantWrong tenant ID in the SCP, or no active subscriptionFix the SCP; check subscriptions
DirectoryError: The device object by the given ID isn't found.Sync join before the computer syncedExpected until Entra Connect exports the computerWait for sync. Guide
AuthenticationError: The verification of the target computer's SIDDevice certificate doesn't match the one that signed the sync-join blobSync not finishedWait for Entra Connect Sync; the next attempt works
0x80090016 NTE_BAD_KEYSETTPM keyset doesn't existCleared TPM or bad sysprep imageGuide
0x80290407 TPM_E_PCP_INTERNAL_ERRORGeneric TPM errorTPM faultVersion 1809 and later join without the TPM; otherwise disable it
0x80280036 TPM_E_NOTFIPSTPM in FIPS mode not supportedFIPS modeAs above
0x80090031 NTE_AUTHENTICATION_IGNOREDTPM locked outTransient lockoutWait for the cool-down; the join succeeds later
0x80072ee7 WININET_E_NAME_NOT_RESOLVEDServer name not resolvedDNS or proxyCheck enterpriseregistration.windows.net
0x80072efe WININET_E_CONNECTION_ABORTEDConnection ended abnormallyUnstable networkRetry from a stable network
Event ID 220 (with 0x801c001d)Windows can't access the computer object in Active DirectoryReplication: codes 1312 (ERROR_NO_SUCH_LOGON_SESSION) or 1317 (ERROR_NO_SUCH_USER)Often transient; check replication

After the join: PRT and CloudAP codes#

Joined but no SSO? Run dsregcmd /status as the user: AzureAdPrt : NO plus an Attempt Status. The PRT guide explains the flow.

CodeMeaningUsual causeFirst check
0xc000006d STATUS_LOGON_FAILUREHTTP 400 from Entra ID or WS-TrustCredentials or proxyGuide
0xc000006a STATUS_WRONG_PASSWORDHTTP 400 from Entra ID or WS-TrustCredentials, or proxy blocking the computer accountEvents 1081 and 1088 hold the server error
0xc00000d0 STATUS_REQUEST_NOT_ACCEPTEDHTTP 400 from Entra ID or WS-TrustServer-side rejectionEvents 1081 and 1088; event 1022 has the URL
0xc000023c / 0xc00000be / 0xc00000c4Network unreachable, bad network path, unexpected network errorEndpoint blocked, or an HTTP error above 400Event 1084 has the network sub-error
0xc000005f STATUS_NO_SUCH_LOGON_SESSIONRealm discovery couldn't find the user's domainUPN suffix isn't a verified domainGuide
0xc004844c AAD_CLOUDAP_E_OAUTH_USERNAME_IS_MALFORMEDUPN not in the expected formatNon-routable UPN such as contoso.localEvent 1144 shows the UPN sent; whoami /upn should return the internet-style UPN
0xc0048442 AAD_CLOUDAP_E_OAUTH_USER_SID_IS_EMPTYUser SID missing from the ID tokenProxy changing the responseBypass the proxy for Entra endpoints
0xc00484c1 AAD_CLOUDAP_E_WSTRUST_SAML_TOKENS_ARE_EMPTYError from the WS-Trust endpointFederation server or proxyEvent 1088 has the details
0xc004848b AAD_CLOUDAP_E_HTTP_PASSWORD_URI_IS_EMPTYMEX response lists no password URLsMEX misconfigured or alteredFix the MEX configuration
0xc004848c AAD_CLOUDAP_E_HTTP_CERTIFICATE_URI_IS_EMPTYMEX response lists no certificate URLsMEX misconfiguredFix the identity provider's MEX
0xc00cee4f WC_E_DTDPROHIBITEDWS-Trust XML included a DTDIdentity provider configurationStop the provider sending a DTD
AADSTS50155 / AADSTS50034 / AADSTS50126Server errors behind a failed PRTDeleted device, unknown user, wrong or unsynced passwordGuide
WinHTTP 12002 / 12007 / 12029 / 12030Timeout, name not resolved, can't connect, connection errorNetwork or proxyGuide

Device-related AADSTS codes in the 135000 range are in part 5 of the AADSTS list; MDM enrollment codes (0x8018xxxx) are in the Intune enrollment reference.

Event IDs to search for#

CodeMeaningUsual causeFirst check
Event ID 304 / 305 / 307Join failure with phase and codeAny phase aboveGuide
Event ID 201Discovery sub-error (before version 1803)Network or proxyDiscover-phase table
Event ID 204Join-phase error (before version 1803)DRS, TPM or networkJoin-phase table
Event ID 1006 / 1007 (AAD Analytic)Start and end of PRT acquisition; 1007 has the final errorAny PRT failureRead everything logged between them
Event ID 1022 (AAD Analytic)URL being accessedPoints at the failing endpointCheck the proxy path to that URL
Event ID 1081 / 1088 (AAD Operational)Server error from Entra ID / WS-TrustServer-side rejectionGuide
Event ID 1084 (AAD Operational)Network sub-errorConnectivityPair it with event 1022
Event ID 1144 (AAD Analytic)UPN that was sentWrong or non-routable UPNCompare with the user's Entra UPN

How to verify a fix#

  1. Rerun dsregcmd /status elevated: AzureAdJoined : YES, DeviceAuthStatus : SUCCESS, and no pre-join Diagnostic Data block (it only appears while the join is failing).
  2. As the user, AzureAdPrt : YES with a recent AzureAdPrtUpdateTime. If the time is more than four hours old, lock and unlock the device and check again.
  3. In the Microsoft Entra admin center, the device shows the hybrid joined join type with a registered date instead of Pending.
  4. No new errors in the User Device Registration Admin and AAD Operational logs after the next sign-in.

References#

Written and checked against current Microsoft Learn documentation. Test changes with a pilot group before rolling them out to everyone, and if an admin center path has moved since, search for the setting name instead.

Spotted a mistake, or did this fix work differently for you? Email me or message me on LinkedIn — corrections are credited in the article.

Written by

Omer Eltayeb

Intune Subject Matter Expert in Cairo, Egypt, former Microsoft Cloud Solutions Architect, Microsoft Certified Trainer and Microsoft Innovative Educator Expert (2024–26) and Microsoft Elevate Educator Expert (2026–27). I share practical, step-by-step guides, study plans, scripts and toolkits for Microsoft Intune, Configuration Manager, Microsoft Entra ID, Microsoft Defender, Exchange and Microsoft 365 with the community.

Microsoft Certified Trainer (MCT) 2026Microsoft Innovative Educator Expert 2025–2026Microsoft Elevate Educator Expert 2026–2027ISC2 Certified Information Systems Security Professional (CISSP)Microsoft 365 Certified: Enterprise Administrator Expert (MS-102)