Home › Microsoft Intune › 0x87D13B64

Microsoft Intune · 0x87D13B64 · Windows 10 / Windows 11

Microsoft Intune Error 0x87D13B64: SCEP Certificate Deployment Failure on Windows 10/11

The error occurs when a device fails to obtain an SCEP certificate from NDES. Fix by ensuring the NDES service account has 'Request Certificates' permissions, correct template names match between Intune and NDES, and variables in the subject name format are properly populated.

Error Details

FactValueSourceNote
Exact error string0x87D13B64 - The certificate request failedIntune admin center Device status tab-> Indicates SCEP failure
OS build rangeWindows 10 / Windows 11Device OS version in Intune-> Affected operating systems
Registry key involvedHKLM\SOFTWARE\Microsoft\Cryptography\MSCEP\CertificateTemplateNDES server registry-> SCEP template configuration
Relevant service URLhttps://ndes.yourdomain.com/certsrv/mscep/mscep.dllNDES server endpoint-> SCEP request endpoint
Log line signatureSCEP certificate request failed with HTTP 403/500 from NDESC:\ProgramData\Microsoft\IntuneManagementExtension\Logs\AgentExecutor.log-> SCEP failure log entry

Log Files to Check

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:
  1. 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.
  2. 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"
  3. 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.
  4. 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.
  5. 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.
  6. 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 CodeDescription
0x87D13B64SCEP certificate request failed (this error)
0x87D13B65Certificate revocation list (CRL) retrieval failure
0x87D13B66Invalid 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.

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.