Error Details
| Fact | Value | Source | Note |
|---|---|---|---|
| Exact error string | 0x87D1339F | IntuneManagementExtension\Logs\AgentExecutor.log | -> WMI query timeout |
| Affected OS build range | Windows 11 23H2 | Device compliance settings in Intune | |
| Registry key involved | HKLM\SOFTWARE\Microsoft\Windows Management Instrumentation | Windows Registry Editor | -> WMI health |
| Relevant service/endpoint URL | https://graph.microsoft.com/v1.0/deviceManagement/complianceManagementCapabilities | Intune API documentation | |
| Log line signature | WMI query for compliance policy timed out after 300 seconds. | AgentExecutor.log |
Log Files to Check
IntuneManagementExtension\Logs\AgentExecutor.logWindows Management Instrumentation\Logs\wmi_logs.txt
What This Error Actually Means
The error code 0x87D1339F is raised by Microsoft Intune's compliance management component, specifically within the context of evaluating device compliance policies on a Windows 11 system. The issue arises when an attempt to query the Windows Management Instrumentation (WMI) service for compliance policy data times out after exceeding the threshold limit of 300 seconds. This timeout is critical because it indicates that the WMI service or its underlying queries are experiencing significant delays, which can be indicative of a broader system health issue affecting Intune's ability to enforce and monitor policies on the device.Affected Versions and Scope
This error specifically targets devices running Windows 11 23H2. It is important to note that while this issue may appear in other builds, it has been most commonly observed within this specific OS build range due to changes in WMI query performance or configuration settings unique to Windows 11 23H2. The error does not affect devices running earlier versions of Windows 10 or later versions of Windows 11 that have not yet reached the same update cycle as 23H2.Where To Look First: Logs and Event IDs
To diagnose this issue, start by examining two specific log files:C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\AgentExecutor.logC:\Windows\System32\Wbem\Logs\wmi_logs.txt
"WMI query for compliance policy timed out after 300 seconds."
Additionally, review Windows Event Viewer for events related to WMI and Intune management. Specifically, check for event IDs 12 under the "Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin" log, which can provide additional context about WMI operations.
Root Causes
WMI Service Performance Degradation
This is often caused by a slow or unresponsive WMI service. This issue might be due to heavy system load, corrupted WMI repository, or excessive WMI queries from other services. To distinguish this cause, check thewmi_logs.txt for repeated errors or warnings related to query execution.
Inefficient Query Design in Compliance Policies
Sometimes, overly complex or poorly optimized compliance policies can lead to long-running WMI queries. Review the policy configuration and ensure that it is not unnecessarily querying large datasets or performing resource-intensive operations.Network Latency Issues
If your organization's network infrastructure experiences high latency, this could cause delays in communication between Intune and devices, leading to timeouts. Check for network connectivity issues by pinging https://graph.microsoft.com/v1.0/deviceManagement/complianceManagementCapabilities.
Fix Procedure
First, ensure that the WMI service is running without errors. Use PowerShell cmdlet to check its status:
Get-Service -Name "Winmgmt"
If it's not running, start and enable it with:
Start-Service -Name "Winmgmt"
Set-Service -Name "Winmgmt" -StartupType Automatic
To optimize WMI performance, review the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Management Instrumentation. Look for parameters that might be causing delays and adjust them accordingly.
For example, you can modify the AllowRemoteCMCIRequests value to allow remote management:
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Management Instrumentation" -Name "AllowRemoteCMCIRequests" -Value 1 -PropertyType DWORD
To further diagnose the issue, run a WMI connection test using PowerShell:
Test-WmiConnection -ComputerName "." -Namespace "root\cimv2"
If network latency is suspected, use the following cmdlet to check connectivity and performance:
Invoke-RestMethod -Uri "https://graph.microsoft.com/v1.0/deviceManagement/complianceManagementCapabilities" -Method Get
Be cautious when making changes to the WMI service or registry keys, as incorrect modifications can disrupt device functionality and enrollment.
Error Code Variants
First, ensure that the WMI service is running without errors. Use PowerShell cmdlet to check its status:
Get-Service -Name "Winmgmt"
If it's not running, start and enable it with:
Start-Service -Name "Winmgmt"
Set-Service -Name "Winmgmt" -StartupType AutomaticTo optimize WMI performance, review the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Management Instrumentation. Look for parameters that might be causing delays and adjust them accordingly.
For example, you can modify the AllowRemoteCMCIRequests value to allow remote management:
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Management Instrumentation" -Name "AllowRemoteCMCIRequests" -Value 1 -PropertyType DWORDTo further diagnose the issue, run a WMI connection test using PowerShell:
Test-WmiConnection -ComputerName "." -Namespace "root\cimv2"If network latency is suspected, use the following cmdlet to check connectivity and performance:
Invoke-RestMethod -Uri "https://graph.microsoft.com/v1.0/deviceManagement/complianceManagementCapabilities" -Method Get| Code | Description |
|---|---|
| 0x87D1339F | WMI query for compliance policy timed out after 300 seconds. |
| 0x87D13400 | WMI service not responding within expected timeframe. |
| 0x87D1339E | Invalid WMI query syntax or malformed request. |
Verification
After implementing the fixes, verify that the issue has been resolved by checking for the following:- The log file
C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\AgentExecutor.logshould no longer contain any lines indicating WMI query timeouts. - In the Intune admin center > Devices > Compliance, confirm that devices are now reporting their compliance status without errors.
Prevention
To prevent recurrence of this issue, consider implementing a baseline policy for WMI health checks and performance tuning. Additionally, regularly review and optimize your compliance policies to ensure they do not contain overly complex or resource-intensive queries.Get-WinEvent cmdlet with specific filters to quickly identify problematic events related to WMI operations.