In modern Windows environments, joining devices to Azure Active Directory (Azure AD) or enabling hybrid Azure AD join is a foundational step in enabling seamless access and security. While most joins complete successfully, failures can—and do—occur, often leaving IT administrators puzzled. Fortunately, Windows provides a built-in diagnostic tool called dsregcmd that can help effectively troubleshoot device registration and join issues. This article walks through how to use dsregcmd to diagnose such failures and get your devices correctly aligned with Azure AD.
What is dsregcmd?
dsregcmd (Device State Registration Command) is a command-line tool included with Windows 10 and Windows 11 that offers insights into the device’s registration status with Azure Active Directory. By analyzing dsregcmd output, IT administrators can determine whether a device has:
- Successfully joined Azure AD or is Hybrid Azure AD joined
- Failed registration attempts
- The current SSO and PRT (Primary Refresh Token) status
This data is essential when investigating why a device isn’t appearing in Azure AD or is experiencing authentication issues.
Common Device Join Failures
Before diving into diagnostics, it’s important to understand the common reasons for device join failures:
- Incorrect local group policy or registry settings
- Lack of required network connectivity to Microsoft services
- Corrupted system files or pending Windows updates
- Time zone or clock misconfiguration
- Permission issues in the Azure AD environment
For hybrid scenarios, Active Directory Federation Services (AD FS) misconfigurations may also play a role in failed device registrations.
Using dsregcmd for Diagnosis
The basic syntax of dsregcmd is straightforward. Run the following from a Command Prompt or PowerShell session with administrative privileges:
dsregcmd /status
This command delivers a wealth of information. Key sections to pay attention to include:
- Device State: Indicates if a device is Azure AD Joined, domain joined, or hybrid joined.
- AzureAdJoined: Will show YES if Azure AD is configured correctly.
- DomainJoined: Helps confirm if hybrid join is active.
- Tenant Details: Shows the Tenant ID and domain, crucial for verifying the correct Azure AD association.
- SSO State and PRT: Confirm whether Single Sign-On and Refresh Tokens are working.

Example Interpretation
If AzureAdJoined = NO and DomainJoined = YES, the machine is only joined to the on-premises AD and not Azure AD. If both values are YES, the device has a successful hybrid join. A NO value for both usually points to a fundamental problem—either network, configuration, or policy based.
Common Fixes Based on dsregcmd Output
Once you’ve gathered dsregcmd output, common remediation steps might include:
- Ensuring system time and time zone match the domain’s settings
- Checking Group Policy settings under Computer Configuration > Administrative Templates > Windows Components > Device Registration
- Verifying that the required URLs (like login.microsoftonline.com) are reachable
- Running
dsregcmd /leave
followed by a system reboot anddsregcmd /join
to rejoin - Performing a system file check to repair corrupted Windows components using
sfc /scannow

Advanced Logging and Debugging
For detailed logs, administrators can also examine event logs under Applications and Services Logs > Microsoft > Windows > User Device Registration. These offer event IDs such as 304 or 102, which can provide deeper insight into failure reasons.
Combining these logs with dsregcmd status ensures a holistic debugging approach and simplifies decision-making for next steps, including escalation to Microsoft support.
Conclusion
Diagnosing device join failures can be a complex task given the many factors involved. However, the dsregcmd tool offers a centralized snapshot of the device’s registration status, helping identify and resolve issues quickly. Consistent use of this command during onboarding and troubleshooting can significantly reduce downtime and administrative overhead.
FAQ
- What permissions are needed to use dsregcmd?
Run dsregcmd in an elevated Command Prompt or PowerShell window for full access. - Can I reinitiate a join using dsregcmd?
Yes, by runningdsregcmd /join
, you trigger the join process manually. - What does a missing PRT token mean?
If the PRT is absent, Single Sign-On won’t function correctly. This could point to authentication issues or misconfigurations related to the device’s registration state. - Does dsregcmd work on all editions of Windows?
It’s available on Windows 10 and Windows 11 Professional, Enterprise, and Education editions. - Where is the dsregcmd log stored?
While the command itself doesn’t write logs, related events are in the Event Viewer under the User Device Registration logs.
Leave a Reply