All blog posts

6 min read

How to check the primary refresh token with dsregcmd

Entra ID · Windows: check the PRT. Step by step with dsregcmd. The output of dsregcmd /status shows AzureAdPrt : YES.
Contents
  1. What is a primary refresh token?
  2. What do you need?
  3. Step 1: run dsregcmd in the user’s context
  4. Step 2: check the join state
  5. Step 3: read the SSO state
  6. Step 4: find the error code
  7. Step 5: match the code to a cause
  8. User experience
  9. Wrapping up

A user on an Entra joined Windows device keeps getting sign-in prompts, or Conditional Access blocks the sign-in while the device looks compliant. A possible cause is the primary refresh token (PRT): it is missing, or it is no longer renewed. That token carries the device claims Conditional Access evaluates.

In this blog post you read how to check that step by step: what the PRT does, which fields you read in dsregcmd /status, how to find the error code, and what Microsoft names as the cause of common errors.

What is a primary refresh token?

The primary refresh token is a token Windows gets when a user signs in with their work account on a Microsoft Entra joined or Microsoft Entra hybrid joined device. It has two jobs:

  • Single sign-on: apps such as Office, Microsoft Edge and Teams use the PRT through the Web Account Manager (WAM) to sign the user in silently.
  • Conditional Access: the PRT carries device and user claims, which Microsoft Entra ID uses to evaluate policies such as “require a compliant device”.

Microsoft gives a PRT a validity of 90 days; it is renewed continuously as long as the user uses the device. The CloudAP plug-in renews it every four hours during Windows sign-in; if that fails, the PRT eventually expires. Microsoft names as the result that single sign-on to Microsoft Entra resources no longer works properly and that the user sees sign-in prompts.

What do you need?

  • A Windows 10 or Windows 11 device that is Microsoft Entra joined or Microsoft Entra hybrid joined.
  • Access to the device while the affected user is signed in, because the PRT is per user.
  • For DeviceAuthStatus (step 2) and the diagnostic fields (step 4): Windows 10 version 21H1 or later.

Step 1: run dsregcmd in the user’s context

The SSO part of dsregcmd only gives a valid status when the command runs in the context of the user. Microsoft therefore has you sign in with the account that has the problem and open the command prompt there.

  1. Sign in to Windows with the account that has the problem, or have the user do so.
  2. Open Command Prompt from Start.
  3. Run the command:
REM Show the device join state and the SSO state of the signed-in user
dsregcmd /status

💡 A normal command prompt of the user is enough; that is also what Microsoft prescribes for the SSO part. An elevated command prompt is only needed for extra diagnostics, such as those in the SYSTEM context, and in it the WamDefaultSet field can show an error.

Step 2: check the join state

In the Device State section, read the fields AzureAdJoined and DomainJoined:

AzureAdJoined DomainJoined Meaning
YES NO Microsoft Entra joined
YES YES Microsoft Entra hybrid joined
NO YES Domain joined (when EnterpriseJoined is NO)

Output of dsregcmd /status, Device State section: AzureAdJoined is YES, EnterpriseJoined and DomainJoined are NO, Virtual Desktop is NOT SET; the device name is blacked out.

If AzureAdJoined is NO, the device is not Microsoft Entra joined or hybrid joined, the two situations in which Windows gets a PRT at sign-in. Look at the join first. In the Device Details section, also check DeviceAuthStatus: SUCCESS means the device exists in Entra ID and is enabled.

Step 3: read the SSO state

Find the SSO State section and read these fields:

  • AzureAdPrt: YES if there is a PRT on the device for the signed-in user. NO means acquiring the PRT failed.
  • AzureAdPrtUpdateTime: when the PRT was last renewed, in UTC. If that is more than four hours ago, something is probably preventing the renewal.
  • AzureAdPrtExpiryTime: when the PRT expires if it is not renewed.

Output of dsregcmd /status, SSO State section: AzureAdPrt is YES, followed by AzureAdPrtUpdateTime, AzureAdPrtExpiryTime and AzureAdPrtAuthority; the tenant ID in the authority URL is blacked out.

If the PRT is old, lock the device and unlock it again. That forces a renewal. On a hybrid joined device, wait at least 60 seconds after locking so the PRT acquisition task can finish, then unlock it. Then run dsregcmd /status again and check whether AzureAdPrtUpdateTime has changed.

Step 4: find the error code

If acquiring or renewing the PRT failed after the last successful update, dsregcmd shows the fields AcquirePrtDiagnostics or RefreshPrtDiagnostics with the value PRESENT under AzureAdPrt. Below them you find, among others:

  • Attempt Status: the client error code, such as 0xc000006d.
  • Credential Type: what was used for the attempt, for example Password or NGC (Windows Hello).
  • Server Error Code and Server Error Description: the error the server returned. The AADSTS code is usually in the description.

On a shared device this information can come from another user’s sign-in. So check User Identity.

If those fields are missing, no failed attempt has been recorded since the last successful update. On a Windows version older than 21H1, or to investigate an earlier attempt, use Event Viewer:

  1. Open Event Viewer and in the View menu choose Show Analytic and Debug Logs.
  2. Navigate to Applications and Services Logs > Microsoft > Windows > AAD.
  3. In the Analytic log, search for event 1006 (start of the PRT acquisition) and 1007 (end). The events in between belong to that attempt.
  4. Open event 1007 and copy the error code on the General tab. Also look in the Operational log, because that is where the errors are.

Step 5: match the code to a cause

The PRT troubleshooting page describes the cause and solution per code. A few that Microsoft names:

  • AADSTS50155 (Device authentication failed): the device may have been deleted or disabled in Entra ID. Register it again according to the join type.
  • AADSTS50126 (invalid username or password): wrong credentials, or with password hash sync on a hybrid joined device, a recently changed password has not been synchronized yet. Then wait for the synchronization.
  • AADSTS50034: the user account does not exist in the tenant, for example because the on-premises account is not synchronized.
  • 0xc000006d or 0xc00000d0: the device received a 400 Bad Request; with 0xc000006d the device may also not have reached the authentication service. Look up the AADSTS code from Server Error Description.
  • Network errors such as ERROR_WINHTTP_NAME_NOT_RESOLVED or ERROR_WINHTTP_CANNOT_CONNECT: the device does not reach the authentication service. If there is an outbound proxy, the computer account must be able to discover it and authenticate to it silently.

User experience

Once the PRT is acquired and renewed again, apps that use WAM can sign the user in silently again, unless a policy such as sign-in frequency or MFA asks for a new sign-in.

Wrapping up

For sign-in problems on an Entra joined PC, start with dsregcmd /status in the user’s context: check whether the device is joined, whether AzureAdPrt is YES and how old AzureAdPrtUpdateTime is, and use the diagnostic fields or Event Viewer to find the error code. Want users to see the basics for themselves? Endpoint Toolbelt shows the join type and whether the work account has a sign-in token (PRT), and lets the user ask Windows to renew that token without administrator rights.

Sources

  1. Microsoft Learn: Understanding Primary Refresh Token (PRT) in Microsoft Entra ID, accessed on 18 November 2026
  2. Microsoft Learn: Troubleshoot devices by using the dsregcmd command, accessed on 18 November 2026
  3. Microsoft Learn: Troubleshoot primary refresh token issues on Windows devices, accessed on 18 November 2026

All blog posts