Home › Microsoft Intune › 0x87D1041C

Microsoft Intune · 0x87D1041C · Windows 11 22H2

Microsoft Intune Error 0x87D1041C on Windows 11 22H2: MDM Enrollment Failure During Autopilot OOBE

The error occurs due to a misconfiguration in the device's trust environment or network connectivity issues preventing communication with Azure AD. Fix by verifying tenant configuration, ensuring proper certificate installation, and checking network access.

Error Details

FactValueSourceNote
Exact error string0x87D1041C: The device cannot connect to the service. Verify that the device is properly configured and has network access.Windows Event Logs, Intune Management Extension logs->
Affected OS build rangeWindows 11 22H2 (OS Build: 22621.749 and above)Microsoft Update Catalog, Intune documentation->
Registry key involvedHKLM\Software\Microsoft\Windows\CurrentVersion\MDMIntune Management Extension logs, Registry Editor->
Relevant service/endpoint URLhttps://enrollment.manage.microsoft.comNetwork traces, Intune Admin Center->
Log line signature[Error] Device enrollment failed with error code 0x87D1041C. Check network connectivity and service availability.C:\Windows\Logs\Mobile(DeviceEnrollment)\DeviceEnrollment_*.log->

Log Files to Check

What This Error Actually Means

The error code 0x87D1041C is a hexadecimal representation of a failure in the Microsoft Device Management (MDM) enrollment process during Windows Autopilot Out-of-Box Experience (OOBE). This error is raised by the **Intune Management Extension (IME)** service, which acts as the bridge between the device and Microsoft Intune's cloud-based MDM infrastructure. The error string "The device cannot connect to the service" indicates a failure in establishing a secure communication channel with the Intune enrollment endpoint https://enrollment.manage.microsoft.com. The root cause typically involves network connectivity issues, misconfigured proxy settings, or certificate validation failures. The error is logged in the Windows Event Viewer under the Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider log source, with Event IDs 41004 (enrollment initiation) and 41005 (enrollment failure).

Affected Versions and Scope

This error is specific to **Windows 11 22H2** with OS builds **22621.749 and above**. It does not affect earlier OS versions (e.g., Windows 10 21H2 or Windows 11 21H2) or devices enrolled via manual enrollment, Azure AD hybrid join, or non-Autopilot OOBE workflows. The issue is most commonly observed in tenants using **Autopilot OOBE** with Intune-managed devices, particularly when the device's network configuration or proxy settings prevent access to the Intune enrollment service. Tenants using **Microsoft Entra ID (formerly Azure AD) hybrid join** or **Azure AD join** without Autopilot are less likely to encounter this error.

Where To Look First: Logs and Event IDs

The primary log files to analyze are: - C:\Windows\Logs\DeviceEnrollment\DeviceEnrollment_*.log (contains the literal error line: [Error] Device enrollment failed with error code 0x87D1041C) - %ProgramData%\Microsoft\IntuneManagementExtension\Logs\IntuneManagementExtension_*.log (includes IME-specific errors like certificate validation failures) - Windows Event Viewer logs under Applications and Services Logs > Microsoft > Windows > DeviceManagement-Enterprise-Diagnostics-Provider (Event IDs 41004 and 41005). To grep for the error, use PowerShell: Get-Content C:\Windows\Logs\DeviceEnrollment\DeviceEnrollment_*.log | Select-String "0x87D1041C" Event ID 41004 logs the start of the enrollment process, while Event ID 41005 logs the failure. Cross-referencing these events with timestamps in the IME logs can help pinpoint the exact failure point.

Root Causes

1. Network Connectivity or Proxy Misconfiguration

The device cannot reach https://enrollment.manage.microsoft.com due to DNS resolution failures, firewall rules blocking outbound HTTPS traffic, or incorrect proxy settings. To diagnose, use Test-NetConnection enrollment.manage.microsoft.com -Port 443 and check the HKLM\Software\Microsoft\Windows\CurrentVersion\MDM registry key for proxy overrides.

2. Certificate Validation Failure

The device's root certificate store lacks the necessary trust anchors for Intune's enrollment service. This is common in environments with custom root CAs or devices that have not been updated to the latest Windows Update. Verify the device's certificate trust list using certutil -viewstore root.

3. Incorrect Enrollment Policy Configuration

The Autopilot profile in Intune may reference an invalid OMA-URI or enforce a policy that conflicts with the device's configuration. Check the ./Device/Vendor/MSFT/Enrollment/EnrollmentStatus OMA-URI in the Intune profile to ensure it aligns with the device's intended enrollment state.

Fix Procedure

  1. Verify network connectivity: Test-NetConnection enrollment.manage.microsoft.com -Port 443 If the test fails, ensure the device can resolve the domain and that outbound HTTPS traffic is permitted.
  2. Check proxy settings in the registry: Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\MDM -Name ProxySettings If a proxy is configured, ensure it is correctly formatted (e.g., http://proxy.example.com:8080).
  3. Update the device's root certificates: Get-WindowsUpdateLog | Select-String "Certificate" If updates are pending, run Install-WindowsUpdate -KBArticleID "KBxxxxxx" to apply the latest security updates.
  4. Correct the Autopilot profile in the Intune admin center: Navigate to Intune admin center > Devices > Enrollment > Windows enrollment > Autopilot > [Profile Name] and verify the OMA-URI ./Device/Vendor/MSFT/Enrollment/EnrollmentStatus is set to Enrolled.
  5. Force re-enrollment using PowerShell: dsregcmd /leave followed by dsregcmd /join Monitor progress in DeviceEnrollment_*.log.
Modifying the HKLM\Software\Microsoft\Windows\CurrentVersion\MDM registry key can disrupt existing MDM enrollments. Always back up the registry before making changes.

Error Code Variants

Error Code Description Distinguishing Factor
0x87D1041C Connection failure to enrollment service Network or proxy issue
0x87D1041D Authentication failure Device not joined to Microsoft Entra ID
0x87D1041E Policy not found Missing or misconfigured Autopilot profile

Verification

After applying fixes, verify success by checking: 1. The DeviceEnrollment_*.log for a line like [Success] Device enrollment completed with status 0. 2. The Intune admin center > Devices > All devices to confirm the device appears as "Enrolled". 3. Run Get-MgDeviceManagementManagedDevice -Filter "deviceEnrollmentType eq 'windowsAutoEnrollment'" to confirm the device's enrollment type.
Use dsregcmd /status to quickly check the device's enrollment state without parsing logs. Look for MDM enrollment: Enrolled in the output.

Prevention

To prevent recurrence: 1. Deploy a baseline policy in Intune to enforce correct proxy settings: Set-CMIntuneDevicePolicy -ProxyServer "http://proxy.example.com:8080" 2. Schedule regular updates using Get-WindowsUpdateLog to ensure root certificates are current. 3. Monitor enrollment failures using Get-WinEvent -LogName "Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin" -MaxEvents 50 and automate alerts via Azure Logic Apps. By addressing network, certificate, and policy misconfigurations proactively, admins can reduce the incidence of 0x87D1041C during Autopilot OOBE.

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.