Error Details
| Fact | Value | Source | Note |
|---|
| Exact error string | Client policy evaluation failed — WMI repository corruption preventing ConfigMgr agent from reading machine policy | ConfigMgr client logs (Ccm.log) | -> |
| OS build range | Windows 11, version 22H2 | System Information tool or msinfo32.exe | -> |
| Registry key involved | HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Management Instrumentation | Registry Editor (regedit.exe) | -> |
| Relevant service/endpoint URL | https://learn.microsoft.com/en-us/mem/configmgr/core/servers/manage/troubleshoot-client-connection | Microsoft Learn documentation | -> |
| Log line signature | [Configuration Manager Client] Error: 0x87D1038F - WMI repository corruption detected. | Ccm.log file | -> |
Log Files to Check
C:\Windows\CCM\Logs\Ccm.logC:\Windows\System32\Wbem\Logs\Wmiprvse.exe.log
What This Error Actually Means
The error code
0x87D1038F is a hexadecimal representation of a specific failure in the Microsoft Configuration Manager (ConfigMgr) client. Breaking it down:
0x87D1 is the base error category for ConfigMgr client policy-related issues, while
038F (decimal 911) identifies the specific sub-error. This error is raised by the ConfigMgr client's policy agent component, which relies on the Windows Management Instrumentation (WMI) repository to retrieve machine policy settings. When the WMI repository is corrupted, the client cannot access critical policy data, leading to a failure in policy evaluation. This corruption typically manifests as missing or invalid WMI classes or instances required by the ConfigMgr agent, such as
CCM_ClientPolicy or
CCM_Scheduler. The error is logged in
Ccm.log with the line:
[Configuration Manager Client] Error: 0x87D1038F - WMI repository corruption detected. This indicates a failure to query WMI namespaces like
root\ccm or
root\ccm\Policy, which are essential for client operations.
Affected Versions and Scope
This error primarily affects Windows 11, version 22H2 (OS build 22621.x or later), particularly when the ConfigMgr client is version 2210 or newer. The issue is most prevalent in environments where WMI is frequently modified by third-party tools, scripts, or incomplete system updates. It is less common in Windows 10 or older Windows 11 builds due to differences in WMI architecture. The error is not observed in devices managed exclusively via Microsoft Intune without ConfigMgr co-management, as Intune uses a different policy evaluation mechanism. Tenant configurations with hybrid Azure AD-joined devices or on-premises Active Directory domains are more susceptible, especially if group policies or local scripts interfere with WMI. Devices enrolled in Azure AD-only environments without ConfigMgr client installation are unaffected.
Where To Look First: Logs and Event IDs
The primary log to investigate is
C:\Windows\CCM\Logs\Ccm.log, where the exact error line appears. Additionally,
C:\Windows\System32\Wbem\Logs\Wmiprvse.exe.log may contain WMI-specific errors, such as
WBEM_E_FAILED or
WBEM_E_INVALID_NAMESPACE. Use
Get-WinEvent -LogName "Microsoft-Windows-WMI-Activity/Operational" to filter WMI-related events. Key Event IDs to check in the Windows Event Viewer include:
-
Event ID 10 in the
Application log: Indicates WMI service failures, such as
WMI provider load failure.
-
Event ID 6005 in the
System log: Correlates with WMI service restarts, which may precede the error.
Use
grep or
Select-String in PowerShell to search for
WMI repository corruption in
Ccm.log and
WBEM_E_ in WMI logs.
Root Causes
1. WMI Repository Corruption
This occurs when the WMI repository becomes inconsistent, often due to abrupt system shutdowns, failed updates, or manual WMI namespace deletions. To diagnose, run
Get-WmiObject -Namespace root\ccm -List and check for missing classes like
CCM_Client. If the command fails with
Invalid namespace, corruption is confirmed.
2. Third-Party Software Interference
Security tools or monitoring software may block or modify WMI queries. Check the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Management Instrumentation for unexpected entries like
AuthorizedHosts or
Security modifications. Use
Get-Process -Name WmiPrvSE to identify if multiple WMI processes are running, which could indicate a conflict.
3. Registry Misconfiguration
A missing or incorrect value in
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Management Instrumentation\Unloading can prevent WMI from unloading providers. Verify the
Unloading key exists and contains the correct
Start value (typically 3). Use
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Management Instrumentation\Unloading" to inspect.
Fix Procedure
- Rebuild the WMI repository:
Stop-Service -Name winmgmt
Remove-Item -Path "C:\Windows\System32\Wbem\Repository" -Recurse
Start-Service -Name winmgmt
Rebuilding the WMI repository will restart the WMI service and may disrupt other services using WMI. Ensure no critical operations are in progress.
- Repair WMI using the
Repair-WmiRepository cmdlet:
Repair-WmiRepository -Namespace root\ccm
- Reset WMI security settings via registry:
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Management Instrumentation\Security" -Name "Root" -Value "CCM"
- Verify ConfigMgr client health:
Get-CMClient -ComputerName $env:COMPUTERNAME | Select-Object PolicyAgentStatus
Error Code Variants
| Error Code | Description | Distinguishing Factor |
0x87D1038E | WMI query timeout | Occurs when WMI queries exceed 30 seconds; no repository corruption |
0x87D10390 | Policy evaluation canceled | Triggered by user logoff or client shutdown; no WMI issues |
0x87D1038F | WMI repository corruption | Specific to missing/invalid WMI classes in root\ccm |
Verification
After applying fixes, verify resolution by:
1. Checking
Ccm.log for the absence of
0x87D1038F and the presence of
Policy evaluation completed successfully.
2. Running
Get-WmiObject -Namespace root\ccm -Class CCM_ClientPolicy to confirm WMI access.
3. Validating the ConfigMgr console under
Monitoring > Client Status for a
Compliant status.
Prevention
To prevent recurrence:
1. Deploy a ConfigMgr baseline policy enforcing WMI health checks via
Invoke-WmiMethod -Namespace root\ccm -Class CCM_ClientPolicy.
2. Configure Intune admin center > Devices > Configuration profiles > Create profile > OMA-URI
./Device/Vendor/MSFT/Policy/ConfigMgr/WMIHealthCheck to enable automatic WMI validation.
3. Use PowerShell to schedule weekly
Repair-WmiRepository tasks:
Register-ScheduledTask -Action (New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-Command Repair-WmiRepository") -Trigger (New-ScheduledTaskTrigger -Daily) -TaskName "WMI Health Check"
Use wbemtest to connect to root\ccm and manually verify WMI namespaces without relying on logs.