Error Details
| Fact | Value | Source | Note |
|---|
| Exact error string | 0x87D13B64 - The certificate request failed | Intune admin center Device status tab | -> Indicates SCEP failure |
| OS build range | Windows 10 / Windows 11 | Device OS version in Intune | -> Affected operating systems |
| Registry key involved | HKLM\SOFTWARE\Microsoft\Cryptography\MSCEP\CertificateTemplate | NDES server registry | -> SCEP template configuration |
| Relevant service URL | https://ndes.yourdomain.com/certsrv/mscep/mscep.dll | NDES server endpoint | -> SCEP request endpoint |
| Log line signature | SCEP certificate request failed with HTTP 403/500 from NDES | C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\AgentExecutor.log | -> SCEP failure log entry |
Log Files to Check
C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\AgentExecutor.logC:\ProgramFiles\Microsoft Intune\NDESConnectorUI\Logs\Connector.log
What This Error Actually Means
The error code
0x87D13B64 indicates a failure in the Simple Certificate Enrollment Protocol (SCEP) certificate deployment process within Microsoft Intune. Specifically, this error occurs when a Windows 10 or Windows 11 device enrolled in Intune is unable to successfully obtain a certificate from the Network Device Enrollment Service (NDES) or Certificate Registration Point (CRP). The error message "The certificate request failed" typically appears in the Intune admin center under the device's configuration profile status. This issue is raised by the Microsoft Intune Management Extension, which handles SCEP certificate enrollment on behalf of the device.
Affected Versions and Scope
This error affects Windows 10 and Windows 11 devices enrolled in Intune with an SCEP certificate profile. It does not impact other operating systems or certificate deployment methods such as Azure AD Certificate Services (ADCS) or third-party solutions. The issue is specific to environments where NDES or CRP is used for certificate enrollment, particularly when the NDES service account lacks proper permissions on the Certificate Authority (CA) template or there are misconfigurations in the SCEP profile.
Where To Look First: Logs and Event IDs
To diagnose this issue, examine the following logs and event IDs:
1. **Intune Management Extension Log**:
- Path:
C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\AgentExecutor.log
- Search for lines containing:
SCEP certificate request failed with HTTP 403/500 from NDES
2. **NDES Connector Log**:
- Path:
C:\ProgramFiles\Microsoft Intune\NDESConnectorUI\Logs\Connector.log
- Look for error messages near the time of the failed request.
3. **Event Viewer on NDES Server**:
- Navigate to: Event Viewer > Application and Services Logs > Microsoft > Windows > NetworkDeviceEnrollmentService > Admin
- Relevant Event IDs:
-
2: Certificate Request Rejected
-
4: Error Processing Certificate Request
Use the following PowerShell cmdlet to search for relevant events on the NDES server:
Get-WinEvent -LogName "Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin" -MaxEvents 50 | Where-Object { $_.Id -eq 2 -or $_.Id -eq 4 }
Root Causes
The following are the most common root causes for this error:
1. NDES Service Account Lacks 'Request Certificates' Permission
Verify that the NDES service account (or connector machine account) has been granted "Read" and "Enroll" permissions on the CA template used by the SCEP profile.
2. Certificate Template Name Mismatch
Ensure the certificate template name in the Intune SCEP profile matches exactly with the template configured in NDES:
- In Intune:
Certificate type > Template name
- On NDES Server: Registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\MSCEP\CertificateTemplate
3. Intune Certificate Connector Issues
Check if the Intune Certificate Connector is running and has a valid service certificate:
- Status in Intune admin center:
Tenant administration > Connectors and tokens > Certificate connectors
- Log file:
C:\ProgramFiles\Microsoft Intune\NDESConnectorUI\Logs\Connector.log
4. Device Certificate Authentication Failure
The device's Entra ID or Intune device certificate may be missing, expired, or invalid. This certificate is used to authenticate the SCEP request to NDES.
Fix Procedure
Follow these steps to resolve the issue:
- Check Connector Status:
- Navigate to:
Intune admin center > Tenant administration > Connectors and tokens > Certificate connectors
- Ensure the connector status is Active with a recent check-in time.
- If inactive, restart the Microsoft Intune Connector Service on the connector server.
- Review NDES Connector Logs:
- Open:
C:\ProgramFiles\Microsoft Intune\NDESConnectorUI\Logs\Connector.log
- Search for errors near the time of failure using:
Get-Content C:\ProgramFiles\Microsoft Intune\NDESConnectorUI\Logs\Connector.log | Select-String -Pattern "error"
- Test NDES URL Reachability:
- Use PowerShell to verify connectivity:
Invoke-WebRequest https://ndes.yourdomain.com/certsrv/mscep/mscep.dll
- Expected response: HTTP 200 with certificate challenge.
- Verify CA Template Permissions:
- Open Certification Authority MMC on the issuing CA.
- Navigate to:
Certificate Templates > [Your Template] > Properties > Security.
- Ensure NDES service account has "Read" and "Enroll" permissions.
- Correct Template Name Mismatch:
- Update Intune SCEP profile:
Intune admin center > Devices > Configuration profiles > [SCEP Profile] > Properties > Certificate type.
- Match template name with NDES registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\MSCEP\CertificateTemplate.
- Force Device Sync:
- In Intune admin center:
Devices > [Device] > Sync.
- Wait 15 minutes and check status.
Warning: Restarting the NDES service or modifying CA templates can affect certificate enrollment for all devices. Ensure you have proper backups and test changes in a non-production environment first.
Error Code Variants
| Error Code | Description |
| 0x87D13B64 | SCEP certificate request failed (this error) |
| 0x87D13B65 | Certificate revocation list (CRL) retrieval failure |
| 0x87D13B66 | Invalid certificate enrollment policy |
Verification
After applying fixes:
- Check Intune admin center:
Devices > [Device] > Device configuration > SCEP profile > Device status.
- Verify the device's certificate store:
Get-Item -Path Cert:\LocalMachine\My | Where-Object { $_.Subject -like "*[Your Template]*" }
- Confirm no further errors in logs and successful enrollment.
Prevention
To prevent recurrence:
1. Regularly monitor connector health and certificate template permissions.
2. Implement automated checks for template name consistency using:
Get-CertificateTemplate -Name "[TemplateName]" | Select-Object Name, @{n='Permissions';e={$_.Security}}
3. Document all SCEP configurations and ensure they align with NDES settings.
By following this guide, you can effectively diagnose and resolve the
0x87D13B64 error in Microsoft Intune, ensuring seamless certificate deployment across your Windows devices.