Home › Microsoft Intune › 0x87D1041E

Microsoft Intune · 0x87D1041E · Windows 10 / Windows 11

Microsoft Intune Error 0x87D1041E: Device Already Managed - Windows 10/11

The error occurs when a device has a stale MDM enrollment record. Remove old enrollments via Settings or registry cleanup to fix.

Error Details

FactValueSourceNote
Exact error string0x87D1041E (MENROLL_E_DEVICE_MANAGEMENTENABLED)Intune admin center and device logs-> Indicates the device is already managed
Affected OS buildsWindows 10, Windows 11Microsoft documentation-> Applies to all supported versions
Registry key involvedHKLM\SOFTWARE\Microsoft\EnrollmentsRegistry Editor-> Contains stale enrollment GUIDs
Relevant service URLhttps://enterpriseregistration.windows.netMDM event logs-> MDM registration endpoint
Log line signatureEvent ID 76: MDM enrollment error 0x87D1041EWindows Event Viewer-> Indicates enrollment conflict

Log Files to Check

What This Error Actually Means

The error code 0x87D1041E (MENROLL_E_DEVICE_MANAGEMENTENABLED) indicates that the device is already enrolled in an MDM (Mobile Device Management) service, either from a previous Intune tenant, another MDM solution, or a partially completed enrollment process. This error is raised by the Windows MDM client when it detects conflicting enrollment records, preventing a new enrollment attempt. The conflict occurs at the device level, meaning the system believes the device is already managed by an organization, even if that management is no longer valid or intended.

Affected Versions and Scope

This error affects devices running Windows 10 and Windows 11, specifically builds where the MDM client is active. It occurs in environments using Microsoft Intune for device enrollment, particularly when transitioning between tenants, re-enrolling devices, or managing devices with mixed MDM configurations. Devices enrolled via Azure AD Joined (AADJ) or Hybrid Azure AD Joined (HAADJ) are more prone to this issue due to their reliance on MDM for policy application.

Where To Look First: Logs and Event IDs

To diagnose the issue, examine the following logs: C:\Windows\System32\winevt\Logs\Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider_Admin.evtx Filter for Event ID 76, which contains the exact error string: MDM enrollment error 0x87D1041E Additionally, check the registry at: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Enrollments for stale enrollment GUIDs that may be causing conflicts. Use PowerShell to query event logs directly: Get-WinEvent -LogName "Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin" -MaxEvents 50 | Where-Object { $_.Id -eq 76 }

Root Causes

1. Stale Enrollment Record

The device retains enrollment information from a previous Intune tenant or MDM solution. This can occur if the device was enrolled in another organization without proper unenrollment.

2. Group Policy Override

MDM enrollment via Group Policy (GPO) takes precedence over user-initiated enrollment. If GPO is configured for automatic enrollment with a different tenant, it blocks new enrollments.

3. Incorrect User Scope Configuration

In Entra ID, the MDM user scope may be set to "None" or exclude the enrolling user's group, preventing successful enrollment.

4. Partial Enrollment

An interrupted enrollment process left orphaned registry keys and scheduled tasks, causing the device to believe it is already managed.

Fix Procedure

  1. Disconnect Stale Enrollments via Settings: Settings > Access work or school > [Stale Connection] > Info > Disconnect If "Disconnect" is greyed out, proceed to manual cleanup.
  2. Manual Registry Cleanup: Open Registry Editor as Administrator: regedit.exe Navigate to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Enrollments Delete sub-keys with GUIDs that reference the old tenant. Also clear: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\EnterpriseResourceManager\Tracked and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Provisioning\OMADM\Accounts\*
  3. Remove Orphaned Scheduled Tasks: Open Task Scheduler: schtasks.msc Delete folders under: Microsoft > Windows > EnterpriseMgmt that match stale enrollment GUIDs.
  4. Adjust MDM User Scope in Entra ID: Navigate to: Entra admin center > Mobility (MDM and MAM) > Microsoft Intune > User scope Set to "All" or include the enrolling user's group.
  5. Verify GPO Configuration: Check: Computer Configuration > Administrative Templates > Windows Components > MDM Ensure "Enable automatic MDM enrollment using default Azure AD credentials" points to the correct tenant.
  6. PowerShell Cleanup (Optional): Use: dsregcmd /status to check device registration status. For forced cleanup, run: dsregcmd /unregister
Warning: Manually modifying the registry or scheduled tasks can destabilize existing enrollments. Proceed only if you are certain of the stale enrollment's origin.

Error Code Variants

Error CodeDescription
0x87D1041EDevice already managed by another organization (this guide)
0x80180026MDM enrollment blocked by policy (GPO or tenant restrictions)
0x87D1041FDevice not enrolled in MDM but required for management

Verification

After applying fixes, verify successful enrollment by: - Checking Settings > Access work or school for the new tenant. - Confirming device status as "Compliant" in Intune admin center under Devices > All devices. - Reviewing Event Viewer for Event ID 75, indicating successful enrollment. Use PowerShell to validate device status: Get-MgDeviceManagementManagedDevice -Filter "deviceEnrollmentType eq 'windowsAutoEnrollment'"

Prevention

Implement the following measures: 1. Use dsregcmd /status regularly to audit enrollment states. 2. Enforce proper unenrollment procedures before re-enrollment. 3. Monitor Group Policy configurations for MDM settings. 4. Set MDM user scope to "All" unless selective enrollment is required.
TIP: Use Get-WinEvent -LogName "Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin" | Where-Object { $_.Id -eq 76 } to quickly identify stale enrollment attempts.
This comprehensive approach ensures devices are properly enrolled and prevents recurrence of the 0x87D1041E error, maintaining smooth Intune management operations.

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.