Error Details
| Fact | Value | Source | Note |
|---|---|---|---|
| Exact error string | Enrollment certificate renewal failed. Error: 0x87D200B9 | Event Viewer - Microsoft/Windows/DeviceManagement-Enterprise-Diagnostics-Provider/Admin | -> Event ID 76 and 72 |
| Affected OS build range | Windows 10 / Windows 11 | Microsoft Intune documentation | -> Applies to all supported versions |
| Registry key involved | HKLM\SOFTWARE\Microsoft\Enrollments | Windows Registry | -> Contains enrollment state and UPN |
| Relevant service/endpoint URL | sts.manage.microsoft.com:443 | Intune MDM renewal endpoint | -> Required for certificate renewal |
| Log line signature | EnrollmentState=6 (pending re-enrollment) | Registry and Intune admin center | -> Indicates device needs to renew enrollment |
Log Files to Check
C:\Windows\System32\winevt\Logs\Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider%4Admin.evtxMDMDiagReport.xml (downloaded from Intune admin center)
What This Error Actually Means
The error code0x87D200B9 (AGENT_CERT_RENEW_FAILURE) indicates that the Microsoft Intune Management Extension or MDM client failed to renew its enrollment certificate. This is critical because the certificate is essential for maintaining communication between the device and the Intune service. When renewal fails, the device remains enrolled in Intune but cannot receive new configuration profiles or policy updates, leading to compliance failures. The error originates from the DeviceManagement-Enterprise-Diagnostics-Provider component, which logs detailed information about enrollment and certificate lifecycle events.
Affected Versions and Scope
This issue affects devices running Windows 10 and Windows 11 operating systems enrolled in Microsoft Intune for MDM management. It is particularly relevant to organizations using Azure Active Directory (Azure AD) or Microsoft Entra ID for device enrollment. The error can occur across all supported builds of Windows 10 and 11, though newer builds may include additional mitigations or logging improvements. Devices managed via other platforms (e.g., macOS, iOS, Android) are not affected by this specific error code.Where To Look First: Logs and Event IDs
To diagnose the issue, examine the following logs and events: 1. **Event Viewer**: - Navigate toEvent Viewer > Applications and Services Logs > Microsoft > Windows > DeviceManagement-Enterprise-Diagnostics-Provider > Admin.
- Filter for Event ID 76 (Enrollment renewal failure) and Event ID 72 (MDM session error). These events will include the exact error code (0x87D200B9) and the certificate thumbprint that failed renewal.
2. **Certificate Store**:
- Open the Local Machine certificate store via certlm.msc.
- Navigate to Personal > Certificates and look for certificates issued by 'Microsoft Intune MDM Agent CA'. Check their expiration dates.
3. **Registry Enrollment Record**:
- Examine the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Enrollments.
- Each enrolled MDM account has a GUID subkey. Look for the EnrollmentState value, where 1 = enrolled and 6 = pending re-enrollment.
4. **Intune Admin Center**:
- Navigate to Devices > select device > Device diagnostic download.
- Extract the MDMDiagReport.xml file from the downloaded ZIP archive for detailed enrollment history and certificate status.
Root Causes
1. Expired or Near-Expiry Certificate
The MDM enrollment certificate may have expired or be within its final renewal window (typically 90 days before expiry). Auto-renewal requires continuous internet access tosts.manage.microsoft.com:443. If the device is offline during this period, renewal fails.
2. Clock Skew on Device
A clock skew greater than 5 minutes can cause certificate renewal requests to fail due to TLS validity window checks. This is common in devices with unsynchronized clocks or misconfigured time services.3. Network Connectivity Issues
The device may be unable to reach the Intune MDM renewal endpoint atsts.manage.microsoft.com:443. This could be due to firewall rules, proxy configurations, or network outages blocking port 443 traffic.
4. Trust Store Update Failure
If Microsoft has rotated its intermediate certificates, devices that have not updated their trusted root stores will fail certificate renewal. This is rare but possible during global CA updates.Fix Procedure
- Force Re-enrollment via Registry:
- Open an elevated PowerShell session.
- Identify the enrollment GUID:
Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Enrollments'. - Set EnrollmentState to 6 (pending re-enrollment):Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Enrollments\. - Trigger a sync:' -Name EnrollmentState -Value 6 Invoke-MgDeviceManagementManagedDeviceSyncDevice -DeviceId "" - Manual Re-enrollment:
- Disconnect the work account via Settings > Accounts > Access work or school.
- Use the Intune admin center to send a new enrollment email:
Intune admin center > Devices > Enroll devices > Windows enrollment. - Clock Synchronization:
- Ensure W32Time service is running and configured for NTP:
Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\Parameters' -Name Type -Value 'NTP'. - Restart the service:Restart-Service w32time. - Force sync:w32tm /resync /force. - Network Connectivity Check:
- Test connectivity to the renewal endpoint:
Test-NetConnection -ComputerName sts.manage.microsoft.com -Port 443. - Ensure no firewall or proxy rules block port 443 traffic.
Warning: Forcing re-enrollment via the registry can dis-enroll devices. Always verify the device's enrollment state in the Intune admin center after making changes.
Error Code Variants
| Error Code | Description | Distinguishing Factors |
|---|---|---|
| 0x87D200B9 | AGENT_CERT_RENEW_FAILURE | Certificate renewal failure during MDM enrollment |
| 0x87D200BA | AGENT_CERT_VALIDATION_FAILED | Failed to validate the existing certificate |
| 0x87D200BB | AGENT_CERT_STORE_FAILURE | Unable to access or modify the certificate store |
Verification
After applying fixes, verify success by: 1. Checking Event Viewer forEvent ID 75 (Certificate renewal success).
2. Confirming updated compliance status in the Intune admin center.
3. Verifying certificate expiry date via PowerShell:
Get-ChildItem Cert:\LocalMachine\My | Where-Object {$_.Issuer -match 'Intune'} | Select-Object NotAfter.
Prevention
Implement these measures to avoid recurrence: 1. **Monitor Certificate Expiry**: Use Intune reports or PowerShell scripts to track certificate lifecycles.Get-MgDeviceManagementManagedDeviceCertificateState -Filter "certificateExpiryDateTime leq now() add 90 days"
2. **Maintain Accurate Time Sync**:
- Ensure all devices use reliable NTP sources.
- Regularly audit time service configurations.
3. **Network Access Policies**:
- Whitelist sts.manage.microsoft.com:443 in firewalls and proxies.
- Monitor connectivity to this endpoint using Azure Network Watcher or similar tools.
4. **Trust Store Management**:
- Regularly update trusted root certificates on devices.
- Monitor Microsoft's public announcements for CA rotations.
Tip: Use the
This comprehensive guide ensures that sysadmins can effectively diagnose, resolve, and prevent the dsregcmd /status command to quickly verify device enrollment status and certificate details without opening Event Viewer or PowerShell.
0x87D200B9 error in Microsoft Intune environments.