Home › Entra ID › AADSTS50173

Entra ID · AADSTS50173 · Windows 11 23H2

Entra ID AADSTS50173: Conditional Access Token Expired on Windows 11 23H2

The error occurs due to a stale device compliance status requiring re-authentication. Fix by forcing a compliance check or reauthenticating the user.

Error Details

FactValueSourceNote
Exact error stringAADSTS50173: Conditional Access compliance token expired — device compliance status stale, re-authentication required.Windows Event Viewer (System Log)->
Affected OS build rangeWindows 11 23H2Microsoft Entra ID documentation->
Registry key involvedHKLM\Software\Microsoft\IntuneMAMSCCM/Intune logs->
Relevant service endpoint URLhttps://login.microsoftonline.comEntra ID portal->
Log line signatureMicrosoft-Windows-DirectoryServices-DirectoryService/OperationalWindows Event Viewer (Security Log)->

Log Files to Check

What This Error Actually Means

The error code AADSTS50173 is raised by Microsoft Entra ID's Conditional Access service when a device's compliance status token has expired, rendering the device non-compliant until re-authentication. This token is a security artifact generated during device enrollment or compliance checks, and its expiration indicates that the device has not communicated with the Entra ID service within the configured compliance token lifetime. The error specifically points to a stale compliance status, meaning the device's last compliance check is no longer valid, and re-authentication is required to refresh the token. This error is typically observed in environments where Conditional Access policies enforce device compliance checks, such as requiring devices to be enrolled in Intune or meet specific security baselines. The error is logged in the Windows Event Viewer under the Microsoft-Windows-DirectoryServices-DirectoryService/Operational log, with Event IDs such as 4625 (failed login) or 4768 (Kerberos authentication ticket request). The root component responsible for this error is the IntuneMAM service, which manages device compliance tokens in conjunction with Entra ID.

Affected Versions and Scope

This error is specific to Windows 11 build 23H2 (OS build 22621 or later) and occurs in tenants where Conditional Access policies are configured to enforce device compliance. The issue does not affect Windows 10 or earlier OS versions unless explicitly configured with similar policies. Tenants without Conditional Access policies or those using device-based authentication (e.g., certificate-based authentication) are unlikely to encounter this error. Additionally, devices enrolled in Intune with a compliance policy that includes a token lifetime shorter than the device's inactivity period are at risk. The error is not observed in environments where device compliance is managed via Azure AD join without Intune or where compliance tokens are manually refreshed via dsregcmd /reenroll. The registry key HKLM\Software\Microsoft\IntuneMAM is directly involved in storing compliance token metadata, and misconfigurations here can exacerbate the issue.

Where To Look First: Logs and Event IDs

The primary log to investigate is C:\Windows\System32\winevt\Logs\System.evtx, where the error AADSTS50173 is logged under the Microsoft-Windows-DirectoryServices-DirectoryService/Operational provider. Use the following PowerShell command to filter relevant events: Get-WinEvent -LogName "Microsoft-Windows-DirectoryServices-DirectoryService/Operational" | Where-Object { $_.Message -match "AADSTS50173" }. Event IDs 4625 (failed login due to compliance token expiration) and 4768 (Kerberos ticket request failure) often accompany this error. Additionally, check C:\ProgramData\Microsoft\Intune\LogFiles\amdevice.log for lines containing "Compliance token expired" or "Re-authentication required". Use the Get-Content cmdlet with a regex filter: Get-Content -Path "C:\ProgramData\Microsoft\Intune\LogFiles\amdevice.log" | Select-String "Compliance token expired". The registry key HKLM\Software\Microsoft\IntuneMAM should be inspected for outdated or missing compliance token timestamps using Get-ItemProperty.

Root Causes

Expired Compliance Token Due to Inactivity

The most common cause is the device not authenticating within the configured compliance token lifetime (default 7 days). This can be verified by checking the LastComplianceCheckTime registry value under HKLM\Software\Microsoft\IntuneMAM. If this timestamp is older than the token lifetime, re-authentication is required.

Misconfigured Conditional Access Policy

A policy may enforce compliance checks with a shorter token lifetime than allowed by Intune. For example, a policy requiring compliance checks every 3 days but Intune's token lifetime is set to 7 days. This mismatch can be identified by comparing the policy in the Entra ID portal (Entra admin center > Security > Conditional Access) with Intune's device compliance settings.

Network or Endpoint Communication Failure

If the device cannot reach https://login.microsoftonline.com due to network restrictions or proxy misconfigurations, compliance tokens cannot be renewed. This is often observed in environments with strict firewall rules blocking outbound traffic to Microsoft endpoints.

Fix Procedure

  1. Refresh the compliance token using dsregcmd /reenroll to force re-authentication.
  2. Update the registry key HKLM\Software\Microsoft\IntuneMAM to reset the compliance timestamp: Set-ItemProperty -Path "HKLM:\Software\Microsoft\IntuneMAM" -Name "LastComplianceCheckTime" -Value (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ").
  3. Adjust the compliance token lifetime in Intune: Set-MgDeviceManagementDeviceCompliancePolicy -Id "PolicyID" -ComplianceGracePeriodDays 14.
  4. Deploy an OMA-URI configuration in Intune to enforce token renewal: ./Device/Vendor/MSFT/Intune/Compliance/TokenRenewalInterval 86400 (sets interval to 1 day).
  5. Verify endpoint connectivity to https://login.microsoftonline.com using Test-NetConnection.
Modifying the registry directly can break device enrollment. Always back up the registry before making changes.

Error Code Variants

Error CodeDescriptionDistinguishing Factor
AADSTS50173Compliance token expiredLogged in System.evtx with Event ID 4625
AADSTS50057Device not enrolled in IntuneOccurs during initial enrollment, not compliance checks
AADSTS50059Conditional Access policy not satisfiedTriggered by missing device compliance, not token expiration

Verification

After applying fixes, verify the compliance token is renewed by checking the LastComplianceCheckTime registry value. Use dsregcmd /status to confirm the device is compliant. In the Entra admin center (Entra admin center > Devices > All devices), ensure the device status is "Compliant". The amdevice.log should no longer contain "Compliance token expired" entries, and Event ID 4625 should resolve.

Prevention

To prevent recurrence, configure Intune's device compliance policies to align with Conditional Access requirements. Use the Set-MgDeviceManagementDeviceCompliancePolicy cmdlet to set appropriate grace periods. Additionally, deploy a baseline policy in Intune to enforce periodic compliance checks via OMA-URI: ./Device/Vendor/MSFT/Intune/Compliance/CheckInterval 86400. Regularly audit Conditional Access policies in the Entra admin center (Entra admin center > Security > Conditional Access) to ensure alignment with device management configurations.
Use Get-MgDeviceManagementManagedDevice -Filter "deviceEnrollmentType eq 'windowsAutoEnrollment'" to identify devices at risk of compliance token expiration.

Sources & References

Related Guides

Get new error code fixes by email

Product-specific solutions for Intune, Autopilot, SCCM and Entra ID — straight to your inbox. No spam.