dsregcmd /status shows a Windows device's Microsoft Entra join state, tenant, token and diagnostic results in one output. To troubleshoot a device that won't Microsoft Entra hybrid join, run dsregcmd /status from an elevated command prompt and read three things: DomainJoined and AzureAdJoined in Device State, then Error Phase and Client ErrorCode in Diagnostic Data. The error phase (pre-check, discover, auth or join) tells you where registration stopped, and the client error code maps to a specific cause such as an unreadable service connection point, a proxy blocking the SYSTEM account, a federation server problem, or a computer object that Microsoft Entra Connect hasn't synced yet.
Who this is for and what you will have at the end
This guide is for administrators running hybrid identity with Microsoft Entra Connect whose domain-joined Windows devices don't hybrid join, sit in Pending, or join but give users no single sign-on.
At the end you will be able to:
- Run
dsregcmd /statusin the right context and know which sections to trust. - Map an error phase and client error code to its cause and fix.
- Check the service connection point (SCP) and network path the device uses.
- Confirm the result in the Microsoft Entra admin center and with Microsoft Graph PowerShell.
- Recover devices stuck in Pending and re-register a device cleanly.
Hybrid join usually exists to support device-based Conditional Access; the policy side is covered in requiring compliant devices with Conditional Access.
How hybrid join works
- The device reads the SCP object from the configuration naming context of its Active Directory forest. The SCP holds two keywords,
azureADId:<TenantID>andazureADName:<verified domain>. The verified domain decides whether the device follows the managed or federated registration flow. - Registration runs in the SYSTEM context, triggered by a scheduled task. The task is under Task Scheduler Library > Microsoft > Windows > Workplace Join > Automatic-Device-Join.
- In managed domains (password hash sync or pass-through authentication), the device performs a sync join. The computer object must first be synced to Microsoft Entra ID by Microsoft Entra Connect, so a first attempt before sync fails by design.
- In federated domains, the device gets a token from the federation service through integrated Windows authentication to a WS-Trust endpoint. From Windows 10 1803, if that fails, Windows falls back to sync join unless the fallback is disabled.
dsregcmd /status reports the outcome of these steps. The combination of three values in Device State gives the join type:
| AzureAdJoined | EnterpriseJoined | DomainJoined | Device state |
|---|---|---|---|
| YES | NO | NO | Microsoft Entra joined |
| NO | NO | YES | Domain joined |
| YES | NO | YES | Microsoft Entra hybrid joined |
| NO | YES | YES | On-premises DRS joined |
Prerequisites
Confirm the environment first. Many "device" problems are configuration problems that affect every machine in an OU or site.
- Microsoft Entra Connect version 1.1.819.0 or later, with Configure device options > Configure Microsoft Entra hybrid join completed for each forest.
- Sync scope: the OUs that contain the computer objects are selected in Microsoft Entra Connect, and the default device attributes are not excluded from sync.
- Device setting: users are allowed to register their devices with Microsoft Entra ID.
- Network access from the SYSTEM context to:
https://enterpriseregistration.windows.nethttps://login.microsoftonline.comhttps://device.login.microsoftonline.comhttps://autologon.microsoftazuread-sso.com(if you use seamless SSO)- Your federation service (federated domains only)
- Proxy: if you need an outbound proxy, the computer account must be able to discover it (WPAD, or WinHTTP proxy settings from Windows 10 1709) and authenticate to it silently, because registration runs in machine context.
- TLS inspection: exclude
https://device.login.microsoftonline.comandhttps://enterpriseregistration.windows.netfrom break-and-inspect. Inspection interferes with client certificate authentication, device registration and device-based Conditional Access. - Federated domains: the AD FS WS-Trust endpoints
/adfs/services/trust/2005/windowstransportand/adfs/services/trust/13/windowstransport(plus theusernamemixedandcertificatemixedvariants) enabled. Thewindowstransportendpoints must be intranet-facing only. - Admin roles: Hybrid Identity Administrator to configure Microsoft Entra Connect, Enterprise Administrator credentials for each forest so the wizard can create the SCP, and at least Cloud Device Administrator to view device state in the admin center.
Step 1: Run dsregcmd /status in the right context
The same command returns different information depending on who runs it.
# Elevated prompt: join diagnostics run as SYSTEM, KeySignTest can run
dsregcmd /status
# Normal prompt as the signed-in user: valid User State and SSO State (PRT)
dsregcmd /status| Run from | Use it for | Caveat |
|---|---|---|
| Elevated prompt | Pre-join diagnostics in SYSTEM context, KeySignTest | WamDefaultSet can show an error |
| Normal prompt, signed-in user | AzureAdPrt, NgcSet, WAM state, PRT diagnostics | Diagnostics run as the user, not as SYSTEM |
The User Context line in Diagnostic Data shows SYSTEM, UN-ELEVATED User or ELEVATED User, so you can always tell which run you're looking at.
Step 2: Check the device state
Compare these fields with the expected values:
| Field | Expected | If not |
|---|---|---|
DomainJoined | YES | The device isn't domain joined and can't hybrid join at all |
AzureAdJoined | YES | The join hasn't finished; read Diagnostic Data |
WorkplaceJoined isn't in this section: Microsoft documents it under User State (see the field table below).
If AzureAdJoined is YES, skip to Step 5. If it's NO, read Diagnostic Data.
dsregcmd /status fields explained
The output has sections: Device State, Device Details, Tenant Details, User State, SSO State, Diagnostic Data and, on some devices, Ngc Prerequisite Check. The table lists the fields you check most often, with what each value means and what to do when it is wrong. Meanings follow Microsoft's dsregcmd documentation; the fixes point to the steps in this guide.
| Field (section) | What it means | Healthy value | If it is wrong |
|---|---|---|---|
AzureAdJoined (Device State) | The device is joined to Microsoft Entra ID | YES for hybrid join | NO: registration hasn't finished; read Diagnostic Data and Step 4 |
DomainJoined (Device State) | The device is joined to an Active Directory domain | YES for hybrid join | NO: the device can't hybrid join; join it to the domain first |
EnterpriseJoined (Device State) | The device is joined to an on-premises DRS. It can't be both EnterpriseJoined and AzureAdJoined | NO for hybrid join | YES means On-premises DRS joined, not hybrid joined |
DomainName (Device State) | Name of the Active Directory domain | Your domain | Empty when not domain joined |
DeviceId (Device Details) | The device's unique ID in the Microsoft Entra tenant | A GUID | Use it to look the device up in the admin center or Graph |
DeviceCertificateValidity (Device Details) | Validity period of the device certificate | A date range that includes today | Expired: run dsregcmd /debug /leave and let the device re-register |
TpmProtected (Device Details) | The device private key is stored in a hardware TPM | YES or NO | NO is valid; the key is software-stored (see the TPM errors in Step 4) |
DeviceAuthStatus (Device Details, Windows 10 21H1 and later) | Health of the device in Microsoft Entra ID | SUCCESS | FAILED. Device is either disabled or deleted: re-enable the object or re-register. FAILED. ERROR: the test couldn't run; it needs network access to Microsoft Entra ID as SYSTEM |
TenantName / TenantId (Tenant Details) | The tenant the device is joined to | Your tenant | Another tenant, or 0x801c003a: correct the SCP azureADId |
JoinSrvUrl (Tenant Details) | The registration endpoint, https://enterpriseregistration.windows.net/EnrollmentServer/device/ in Microsoft's sample | That endpoint | Make the endpoint reachable as SYSTEM |
MdmUrl (Tenant Details) | MDM enrollment URL | Set if automatic MDM enrollment is configured | Empty: MDM isn't configured or the user isn't in scope. A value doesn't prove the device is managed |
NgcSet (User State) | A Windows Hello key is set for the signed-in user | YES if Windows Hello is used | Check the Ngc Prerequisite Check section |
WorkplaceJoined (User State) | Microsoft Entra registered accounts were added in the current user context | Usually NO on a hybrid joined device | YES: a work account was registered on the device |
WamDefaultSet (User State) | A Web Account Manager default account exists for the user | YES | Can show an error when run elevated; rerun as the signed-in user |
AzureAdPrt (SSO State) | A Primary Refresh Token is present for the signed-in user | YES | NO: read Attempt Status and Server Error Description (Step 5) |
AzureAdPrtUpdateTime / AzureAdPrtExpiryTime (SSO State) | When the PRT was last updated and when it expires if not renewed (UTC) | Recent update time | Old update time: lock and unlock the device and check again |
EnterprisePrt (SSO State) | A PRT from on-premises AD FS is present | YES if you use AD FS | NO on a federated setup: check the federation service |
OnPremTgt / CloudTgt (SSO State) | A Cloud Kerberos ticket for on-premises or cloud resources is present | YES if you use Cloud Kerberos trust | NO: check your Cloud Kerberos configuration |
Error Phase (Diagnostic Data) | Stage where the join stopped: pre-check, discover, auth or join | Not shown after a successful join | Use the phase sections in Step 4 |
Client ErrorCode (Diagnostic Data) | HRESULT returned by the client | Not shown after a successful join | Look it up in the Step 4 tables |
Server ErrorCode / Server Message (Diagnostic Data) | Error and message returned by the server | Not shown after a successful join | See the server messages in Step 4 |
AadRecoveryEnabled (Diagnostic Data) | The stored device keys aren't usable and the device is marked for recovery | NO | YES: the next sign-in re-registers the device |
KeySignTest (Diagnostic Data) | Health of the device keys; needs an elevated prompt | PASSED | Failure usually marks the device for recovery; silent for hybrid joined devices |
Some fields appear only in certain cases. The Device Details and Tenant Details sections show only for Microsoft Entra joined or hybrid joined devices, the pre-join diagnostics show only when a domain-joined device can't hybrid join, and the post-join diagnostics show for joined devices. Run the command as a user to get valid User State and SSO State values.
Step 3: Read the diagnostic tests and error phase
On Windows 10 1803 and later, the pre-join diagnostics look like this:
+----------------------------------------------------------------------+
| Diagnostic Data |
+----------------------------------------------------------------------+
Diagnostics Reference : www.microsoft.com/aadjerrors
User Context : SYSTEM
AD Connectivity Test : PASS
AD Configuration Test : PASS
DRS Discovery Test : FAIL [0x801c0021/0x801c000c]
DRS Connectivity Test : SKIPPED
Token acquisition Test : SKIPPED
Fallback to Sync-Join : ENABLED
Previous Registration : 2019-01-31 09:23:30.000 UTC
Error Phase : discover
Client ErrorCode : 0x801c0021
+----------------------------------------------------------------------+Each test lines up with a phase:
- AD Connectivity Test checks the domain controller. Failures show up in the pre-check phase.
- AD Configuration Test reads and validates the SCP. Failures usually produce
0x801c001din the discover phase. - DRS Discovery Test fetches the registration endpoints and performs a user realm request. Failures appear in the discover phase. The value in brackets is the error and sub-error; in Microsoft's sample it is
0x801c0021/0x801c000c, a generic discovery failure. - DRS Connectivity Test is a basic connectivity test to the registration service.
- Token Acquisition Test gets a token from the federation service for federated tenants. Failures appear in the auth phase.
Below the tests, Error Phase, Client ErrorCode, Server ErrorCode, Server Message and Request Id describe the last failed attempt. Only failed attempts are logged. On Windows 10 versions earlier than 1803, find the same information in Event Viewer under Applications and Services Log > Microsoft > Windows > User Device Registration, events 304, 305 and 307.
Step 4: Fix the failure by phase
Pre-check phase
The device has no line of sight to a domain controller. It must be on the internal network, or on a VPN with network line of sight to an on-premises domain controller, when registration runs.
Discover phase
The device either can't read a valid SCP or can't reach the registration and realm discovery endpoints as SYSTEM. Check the SCP first. For a forest named fabrikam.com:
$scp = New-Object System.DirectoryServices.DirectoryEntry
$scp.Path = "LDAP://CN=62a0ff2e-97b9-4513-943f-0d221bd30080,CN=Device Registration Configuration,CN=Services,CN=Configuration,DC=fabrikam,DC=com"
$scp.KeywordsThe output should list azureADName: with a verified domain and azureADId: with your tenant ID. In a multi-forest environment the SCP must exist in every forest that contains domain-joined computers.
| Client error code | Meaning | Fix |
|---|---|---|
0x801c001d DSREG_AUTOJOIN_ADCONFIG_READ_FAILED | SCP can't be read | Configure the SCP; if event ID 220 is present with error 1312 or 1317, troubleshoot AD replication |
0x801c0021 DSREG_AUTOJOIN_DISC_FAILED | Generic discovery failure | Read the sub-error in the DRS Discovery Test line |
0x801c001f DSREG_AUTOJOIN_DISC_WAIT_TIMEOUT | Discovery timed out | Make https://enterpriseregistration.windows.net reachable as SYSTEM |
0x801c003d DSREG_AUTOJOIN_USERREALM_DISCOVERY_FAILED | Realm discovery failed | Make https://login.microsoftonline.com reachable as SYSTEM |
0x801c003a DSREG_DISCOVERY_TENANT_NOT_FOUND | Wrong tenant ID in SCP, or no active subscription | Correct the SCP tenant ID |
0x80072efd / 0x80072ee2 | Can't connect / network timeout | Open the required endpoints and fix the proxy path |
0x80072f8f WININET_E_DECODING_FAILED | Response couldn't be decoded | Stop the proxy modifying the response |
0x8007000d E_INVALIDDATA | JSON couldn't be parsed, often a proxy returning an HTML sign-in page | Let the SYSTEM context authenticate to the proxy silently |
Auth phase (federated domains only)
The device couldn't get a token silently for the registration service from your federation service. Check the WS-Trust endpoints and the Metadata Exchange (MEX) response. Event ID 305 in the User Device Registration log carries the error and server error codes.
| Client error code | Meaning | Fix |
|---|---|---|
0xcaa90017 ERROR_ADAL_PROTOCOL_NOT_SUPPORTED | Protocol isn't WS-Trust | The identity provider must support WS-Trust |
0xcaa9002c ERROR_ADAL_FAILED_TO_PARSE_XML | Federation service didn't return XML | Make the MEX endpoint return valid XML; check the proxy |
0xcaa90023 ERROR_ADAL_COULDNOT_DISCOVER_USERNAME_PASSWORD_ENDPOINT | No username/password endpoint found | Enable WS-Trust endpoints and publish them in MEX |
0xcaa82ee2 ERROR_ADAL_INTERNET_TIMEOUT | Network timeout | Reach login.microsoftonline.com and the identity provider as SYSTEM |
0xcaa82f8f ERROR_ADAL_INTERNET_SECURE_FAILURE | TLS certificate couldn't be validated | Check client time skew and retry |
0xcaa20003 ERROR_ADAL_SERVER_ERROR_INVALID_GRANT | SAML token not accepted | Check the federation server settings and its logs |
Join phase
The registration request reached the service but was rejected, or the TPM failed. The Registration Type line shows whether it was a sync or federated join.
| Client error code | Meaning | Fix |
|---|---|---|
0x801c03f2 DSREG_E_DIRECTORY_FAILURE | DRS returned DirectoryError | Read the server message (below) |
0x801c0002 DSREG_E_DEVICE_AUTHENTICATION_ERROR | DRS returned AuthenticationError | Read the server error code |
0x80090016 NTE_BAD_KEYSET | TPM keyset missing (TPM cleared, or bad sysprep image) | Don't clear the TPM; build images from machines that were never joined or registered |
0x80290407 TPM_E_PCP_INTERNAL_ERROR | Generic TPM error | Windows 10 1809 and later complete the join without the TPM |
0x80280036 TPM_E_NOTFIPS | TPM in FIPS mode not supported | Disable the TPM or its FIPS mode |
0x80090031 NTE_AUTHENTICATION_IGNORED | TPM locked out | Transient; wait for the cool-down |
The most common server messages for a sync join are:
- "The device object by the given id isn't found." Expected until Microsoft Entra Connect syncs the computer object. Wait for a sync cycle; the next attempt succeeds. If it never does, check that the OU is in sync scope.
- "AADSTS90002: Tenant UUID not found." The tenant ID in the SCP is wrong.
- AuthenticationError mentioning verification of the target computer's SID. Usually sync hasn't finished yet.
- "Your request is throttled temporarily. Please try after 300 seconds." Several requests in quick succession; wait and retry.
Step 5: Check post-join health and the PRT
A device can be joined and still give users no single sign-on. In the elevated output, check:
- DeviceAuthStatus in Device Details:
SUCCESSmeans the device is present and enabled in Microsoft Entra ID.FAILED. Device is either disabled or deletedmeans exactly that. - KeySignTest:
PASSEDmeans the device keys are healthy. A failure usually marks the device for recovery, which is silent for hybrid joined devices at the next sign-in. - AadRecoveryEnabled:
YESmeans the stored keys aren't usable and the next sign-in triggers recovery.
Then, as the signed-in user, check SSO State. AzureAdPrt : NO means the Primary Refresh Token couldn't be acquired. If AzureAdPrtUpdateTime is more than four hours old, lock and unlock the device and check whether it updates. From Windows 10 21H1 the output includes Attempt Status, Server Error Code and Server Error Description for the last failed attempt.
| Error | Cause | Fix |
|---|---|---|
| AADSTS50155 Device authentication failed | Device deleted or disabled in Microsoft Entra ID | Re-enable it, or re-register with dsregcmd /debug /leave |
| AADSTS50126 invalid username or password | Wrong credentials, or a new password not yet synced by password hash sync | Wait for password sync, then sign in again |
| AADSTS50034 user account does not exist | UPN not synced, or a SAM account name sent instead of a UPN | Check sync scope and that whoami /upn returns a routable UPN |
0xc000005f STATUS_NO_SUCH_LOGON_SESSION | UPN suffix isn't a verified domain | Add the domain, or configure an alternate login ID for non-routable suffixes |
0xc004844c USERNAME_IS_MALFORMED | UPN format is wrong | Fix the UPN returned by the domain controller |
Remember that a hybrid joined device disabled in Microsoft Entra ID is re-enabled at the next sync cycle if the computer account is enabled on-premises. Disable it in Active Directory instead.
Verify the join in Microsoft Entra ID
In the Microsoft Entra admin center, browse to Entra ID > Devices > All devices and search for the device. If the Registered column shows Pending, hybrid join hasn't completed. A date and time means it has.
With Microsoft Graph PowerShell, look the device up by the DeviceId from dsregcmd /status:
Connect-MgGraph -Scopes "Device.Read.All"
$id = "00aa00aa-bb11-cc22-dd33-44ee44ee44ee" # DeviceId from dsregcmd /status
Get-MgDevice -Filter "deviceId eq '$id'" |
Select-Object DisplayName, DeviceId, TrustType, AccountEnabled, ApproximateLastSignInDateTimeTrustType should be ServerAd (on-premises domain joined devices joined to Microsoft Entra ID) and AccountEnabled should be True. Note that -DeviceId on Get-MgDevice takes the object ID, not the device ID, which is why the example uses a filter.
Recover devices stuck in Pending
Pending devices exist only for hybrid join. Microsoft Entra Connect creates the device object and sets it to Pending until the device registers. Two scenarios leave it stuck:
- The device never completes registration, usually because of the network or SCP problems in Step 4.
- The object left sync scope and came back. Moving a computer to an OU that isn't synced makes Microsoft Entra Connect delete the device in Microsoft Entra ID. Moving it back creates a new Pending object, and the device, which considers itself already registered, never completes registration.
For the second case, unregister and let the scheduled task re-register:
# Elevated prompt on the affected device
dsregcmd.exe /debug /leave
# Then restart, or sign out and sign in, to trigger Automatic-Device-JoinTo count Pending devices across the tenant:
(Get-MgDevice -All -Filter "TrustType eq 'ServerAd'" |
Where-Object { -not $_.AlternativeSecurityIds }).CountCollect logs when the cause isn't clear
- User Device Registration event log: 304, 305 and 307 for join failures, 201 for discovery sub-errors, 204 for join phase errors.
- AAD operational and analytic logs (Applications and Services Log > Microsoft > Windows > AAD): events 1006 and 1007 bracket PRT acquisition, and 1007 logs the final error code.
Checklist
- Microsoft Entra Connect device options configured; computer OUs in sync scope; default device attributes synced.
- SCP present in every forest with the right
azureADIdand a verifiedazureADName. - Registration and login endpoints reachable as SYSTEM, through a proxy the computer account can authenticate to, without TLS inspection.
- For federated domains, WS-Trust endpoints enabled and published in MEX;
windowstransportintranet-only. dsregcmd /statusshowsDomainJoined : YESandAzureAdJoined : YES,DeviceAuthStatus : SUCCESS, andAzureAdPrt : YESfor the signed-in user.- Device shows a registration date in All devices, not Pending, with
TrustTypeServerAd. - Pending devices recovered with
dsregcmd /debug /leaveand a restart.
What we checked
- Opened Microsoft's "Troubleshoot devices by using the dsregcmd command" page on learn.microsoft.com on 2026-11-24 (page metadata: updated 2026-06-15) and built the field table from its Device State, Device Details, Tenant Details, User State, SSO State, Diagnostic Data and NGC sections.
- Cross-checked the join-state table (AzureAdJoined, EnterpriseJoined, DomainJoined) against that page; the four combinations match.
- Found that Microsoft documents
WorkplaceJoinedunder User State, not Device State, and corrected this guide, which had listed it in Device State. - Compared the documented pre-join sample with the one in Step 3: the sample's DRS Discovery Test line is
FAIL [0x801c0021/0x801c000c], so the guide now uses it. - Confirmed the
DeviceAuthStatusfield was added in Windows 10 version 21H1 and thatKeySignTestrequires elevated privileges, both per the same page. - Documented output: the sample blocks follow Microsoft's samples; tenant and device IDs are Microsoft's placeholders.
- Not tested on a live tenant or device; the fixes in the table follow Microsoft's documentation as of 2026-11-24. The Step 4 error-code tables were carried over from the earlier version and were not re-read against the hybrid join troubleshooting page in this run.
Last tested: 2026-11-24
See also
- Replace an Entra Connect sync server with a staging mode swing migration
- Upgrade Entra Connect Sync to 2.6 with application-based authentication
- Fix Windows 365 Azure network connection health check failures
References
- Troubleshoot devices by using the dsregcmd command
- Troubleshoot Microsoft Entra hybrid joined devices
- Configure Microsoft Entra hybrid join
- Manual configuration for Microsoft Entra hybrid join
- Verify Microsoft Entra hybrid join state
- Pending devices in Microsoft Entra ID
- Microsoft Entra device management FAQ
- Get-MgDevice
- device resource type
Comments
Questions and tips are welcome. Comments are checked by the EpiFive team before they appear; please do not share passwords, phone numbers or other private details.