Home › Microsoft Intune › 0x87D20017

Microsoft Intune · 0x87D20017 · Windows 11 22H2

Intune Compliance Policy Not Found Error 0x87D20017 Windows 11 22H2

Device reports no applicable compliance policy assigned in Intune due to misconfiguration or missing assignment; check device group membership and policy scope.

Error Details

FactValueSourceNote
Exact error stringCompliance policy not foundIntune compliance status report->
Affected OS build rangeWindows 11 22H2Device properties in Intune portal
Registry key or OMA-URI involvedDevice Management\Compliance PoliciesLocal device registry->
Relevant service/endpoint URLhttps://graph.microsoft.com/v1.0/deviceManagement/compliancePolicies/Intune API endpoint
Log line signatureError 0x87D20017: Compliance policy not found.Device compliance log file->

Log Files to Check

What This Error Actually Means

The error code 0x87D20017, "Compliance policy not found," is raised by Microsoft Intune when a device running Windows 11 22H2 reports that it cannot find any applicable compliance policies assigned to it through the Intune service. This issue typically occurs during the evaluation of compliance status on the client side, where the device checks for its current state against the defined policy settings in the Intune portal. The error is generated by the Device Management component within Windows 11, which interacts with Microsoft Graph API endpoints to fetch and apply policies from the cloud. When a device fails to retrieve or recognize compliance policies set up through Intune, it logs this specific error code along with other relevant diagnostic information in various system logs.

Affected Versions and Scope

This issue is observed specifically on Windows 11 build 22H2 devices that are enrolled into Microsoft Intune for management purposes. The problem does not affect earlier or later versions of the operating system unless they have been updated to include the same version of the Device Management component responsible for compliance checks. The scope of this error is limited to devices where a compliance policy has been configured in the Intune admin center but either hasn't been properly assigned, or there's an issue with how the device fetches and applies these policies. It does not impact other management operations such as app deployment, configuration profiles, or enrollment status.

Where To Look First: Logs and Event IDs

To diagnose this error effectively, start by examining the following logs: - C:\Windows\System32\winevt\Logs\Microsoft-Windows-Intune_DeviceManagement-MDMWMI_Events.evtx: This log file contains detailed entries about Intune device management operations and compliance checks. - /var/log/microsoft/mdm.log: On Linux-based systems or virtual machines running Windows, this log tracks MDM-related activities including policy application attempts. Look for the exact error line: Error 0x87D20017: Compliance policy not found. Additionally, check Event IDs 5439 and 5440, which are related to Intune compliance status updates. These events provide additional context about the device's interaction with Intune services during compliance evaluation.

Root Causes

Poor Network Connectivity or Firewall Issues

One common cause is poor network connectivity between the device and Microsoft Graph API endpoints, such as https://graph.microsoft.com/v1.0/deviceManagement/compliancePolicies/. This can be due to firewalls blocking necessary ports or overly restrictive security policies.

Incomplete Policy Assignment in Intune

Another reason could be that the compliance policy has not been correctly assigned to the target device group or user roles within the Intune admin center. Ensure that all intended devices are properly included in the scope of your compliance policies.
Be cautious when manually editing registry keys related to compliance checks, as incorrect changes can render enrolled devices non-compliant and potentially unenrollable.

Device-Side Configuration Issues

The device itself might have issues with its local configuration or settings that prevent it from properly fetching or applying Intune policies. This includes problems like outdated MDM components or registry entries.

Fix Procedure

To resolve the issue, follow these steps: 1. Verify network connectivity to https://graph.microsoft.com/v1.0/deviceManagement/compliancePolicies/. Use tools like curl -I https://graph.microsoft.com/v1.0/deviceManagement/compliancePolicies/ or PowerShell cmdlets such as:
Invoke-MgGraphRequest -Method GET -Uri "https://graph.microsoft.com/v1.0/deviceManagement/compliancePolicies/"
2. Navigate to the Intune admin center > Devices > Compliance policies and ensure that your compliance policy is correctly assigned to the relevant device groups or users. 3. Use PowerShell cmdlets to check if the policy is being applied properly:
Get-MgDeviceManagementManagedDevice -Filter "deviceEnrollmentType eq 'windowsAutoEnrollment'"
4. Check the local registry on affected devices at HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceRegistration. Ensure that any settings here are not conflicting with Intune policies. 5. Use OMA-URI strings to configure device settings directly from Intune, such as:
./Device/Vendor/MSFT/MDM/ComplianceSettings/PolicyStatus
6. Review and adjust firewall rules or security policies to allow necessary traffic for MDM operations.

Error Code Variants

Code Description Distinguishing Factors
0x87D20016 Policies not found - similar to 0x87D20017 but indicates a different type of policy (e.g., configuration profile) Error message mentions "configuration" instead of "compliance"
0x87D20018 Policies not applicable - indicates that policies exist but are not relevant to the device's current state or role. Error message includes "not applicable" rather than "not found"

Verification

After applying fixes, verify success by checking for updated log entries in C:\Windows\System32\winevt\Logs\Microsoft-Windows-Intune_DeviceManagement-MDMWMI_Events.evtx. Look for Event ID 5440 indicating successful policy application. Additionally, confirm through the Intune admin center that the device's compliance status reflects the correct policies.

Prevention

To prevent recurrence of this issue, ensure regular audits of network configurations and firewall rules to maintain proper connectivity with Microsoft Graph API endpoints. Implement a baseline configuration for devices ensuring all necessary registry keys are set correctly before enrolling them into Intune management.
A quick diagnostic shortcut is to use the dsregcmd /status command on affected devices, which provides immediate insight into MDM registration status and can help identify network or configuration issues.
This guide should provide a comprehensive approach for troubleshooting and resolving compliance policy-related errors in Microsoft Intune environments.

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.