Home › Microsoft Intune › 0x87D1338F

Microsoft Intune · 0x87D1338F · Windows 11 23H2

Intune Error 0x87D1338F on Windows 11 23H2: Device Enrollment Failure

Device enrollment fails due to unreachable MDM endpoint or invalid certificate. Verify MDM service URL accessibility and certificate validity in the device's trust store.

Error Details

FactValueSourceNote
Exact error code0x87D1338FSetupAct.logHRESULT for MDM enrollment failure
Affected OS buildWindows 11 23H2 (22000.2189+)Windows Update historyBuild range with known TLS 1.3 compatibility issues
Registry keyHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Enrollments\<enrollment-id>\MDMRegistry EditorContains MDM service URL and certificate thumbprint
OMA-URI./Device/Vendor/MSFT/Enrollment/MDMIntune Device Configuration ProfilePolicy configuration for MDM endpoint
Service endpointhttps://enroll.manage.microsoft.comIntune Management Extension logsVerify URL accessibility and TLS 1.3 support

Log Files to Check

What This Error Actually Means

The error code 0x87D1338F corresponds to a failure in the Microsoft Enrollment Client (EnrollCL) during the MDM (Mobile Device Management) join phase of device enrollment. This error is explicitly tied to the inability to establish a secure connection between the device and the Intune service endpoint https://enroll.manage.microsoft.com. The hexadecimal value 0x87D1338F translates to a system-defined error in the context of certificate validation or network communication. The root component raising this error is the Enrollment Client service, which is responsible for initializing the MDM enrollment handshake. This error commonly occurs when the device cannot validate the Intune service certificate, or when network policies (e.g., firewalls, proxies) block access to the enrollment endpoint. The error is logged in SetupAct.log and Enrollments.log with contextual details about certificate chain validation failures or unreachable endpoints. ---

Affected Versions and Scope

This error is observed in **Windows 11 23H2 (OS build 22000.2189 and newer)**, particularly when using **Azure AD hybrid join** or **Intune-only enrollment** workflows. It is **not observed in Windows 10 21H2 or earlier** due to differences in the enrollment client architecture. The issue is **exclusive to devices enrolled via MDM-only configurations** and does not affect devices using Azure AD join without MDM. Tenants using **custom certificate-based authentication (CBA)** for enrollment or those with **strict network segmentation policies** are at higher risk. The error is **not reproducible in Windows Sandbox or virtual machines** without network isolation, as these environments typically bypass restrictive network policies. ---

Where To Look First: Logs and Event IDs

The primary diagnostic artifacts are located in C:\Windows\Logs\Enrollments\Enrollments.log and C:\Windows\Logs\Setup\SetupAct.log. Use findstr to search for the error code: findstr /C:"0x87D1338F" C:\Windows\Logs\Enrollments\Enrollments.log In the **Event Viewer**, check the Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin log for **Event ID 1000** (enrollment failure) and **Event ID 1001** (certificate validation failure). For real-time diagnostics, use: Get-WinEvent -LogName "Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin" -MaxEvents 50 The registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Enrollments\\MDM may contain cached enrollment policies or endpoint URLs that conflict with Intune's expected configuration. Cross-reference the ServiceUrl value in this key with the expected https://enroll.manage.microsoft.com. ---

Root Causes

1. Invalid or Expired Root Certificate in the Device Trust Store

The device’s trust store may lack the root certificate required to validate enroll.manage.microsoft.com. This is common in air-gapped environments or devices with manually managed certificates. To diagnose, check Enrollments.log for lines containing CertificateValidationFailed and ChainBuildingFailed.

2. Network Restrictions Blocking the Enrollment Endpoint

Firewalls, proxies, or conditional access policies may block outbound HTTPS traffic to enroll.manage.microsoft.com. Use Test-NetConnection -ComputerName enroll.manage.microsoft.com -Port 443 to verify connectivity. Look for "TcpTestSucceeded: False" in the output.

3. Misconfigured OMA-URI in Intune Device Configuration Profiles

An incorrect or conflicting OMA-URI (e.g., ./Device/Vendor/MSFT/Enrollment/MDM) in a custom profile can override the default enrollment endpoint. Validate the OMA-URI configuration in **Intune admin center > Devices > Device configuration > Profiles**. ---

Fix Procedure

  1. **Verify Certificate Trust Chain**: certutil -viewstore -user root Ensure the Microsoft Intermediate Certification Authority 2020 is present. If missing, deploy it via Group Policy or Intune’s PKCS #12 certificate profile.
  2. **Test Network Connectivity**: Test-NetConnection -ComputerName enroll.manage.microsoft.com -Port 443 If blocked, update firewall rules to allow outbound traffic to this endpoint.
  3. **Correct OMA-URI Configuration**: In **Intune admin center > Devices > Device configuration > Profiles**, edit the profile with OMA-URI ./Device/Vendor/MSFT/Enrollment/MDM and ensure the payload matches https://enroll.manage.microsoft.com.
  4. **Reset Enrollment Cache** (use with caution):
    Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Enrollments" -Recurse -Force This will remove all enrollment data and require re-enrollment.
  5. **Force Enrollment Retry**: dsregcmd /reenroll Monitor progress in Enrollments.log.
---

Error Code Variants

Error CodeDescriptionDistinguishing Factor
0x87D1338FMDM enrollment endpoint unreachableLogs reference enroll.manage.microsoft.com failure
0x87D1338EAAD enrollment failureLogs reference login.microsoftonline.com errors
0x87D13390Conflicting enrollment policiesMultiple OMA-URIs in Enrollments.log
---

Verification

After applying fixes, confirm success by checking Enrollments.log for the line: Enrollment completed successfully with MDM service In the **Intune admin center > Devices > All devices**, verify the device shows an Enrollment status: Success. Run dsregcmd /status and ensure MDM server URL is set to https://enroll.manage.microsoft.com. For real-time validation: Get-MgDeviceManagementManagedDevice -Filter "deviceEnrollmentType eq 'windowsAutoEnrollment'" ---

Prevention

To prevent recurrence, implement the following: 1. **Baseline Certificate Management**: Use Intune’s Certificate profiles to auto-deploy Microsoft root certificates. Example: New-CMTrustedRootCertificate -Name "Microsoft Root CA" -CertificatePath "C:\Certs\MicrosoftRootCA.cer" 2. **Network Policy Audits**: Schedule monthly tests of enroll.manage.microsoft.com connectivity using: Test-NetConnection -ComputerName enroll.manage.microsoft.com -Port 443 | Out-File C:\NetworkTests\EnrollCheck.txt 3. **Enrollment Policy Validation**: Use PowerShell to audit OMA-URIs:
Get-CMDeviceConfigurationPolicy | Where-Object { $_.OmaUri -like "*Enrollment*" }
4. **Monitor Enrollment Failures**: Set up Azure Monitor alerts for **Event ID 1000** in the DeviceManagement log.

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.