Solution:
Root Cause: Orphaned Local MDM Enrollment GUID Registry Subkeys
If a previous enrollment attempt or un-enrollment process was interrupted (e.g., via hard reset or ungraceful network disconnection), Windows leaves orphan registry hives under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Enrollments\[GUID] alongside scheduled tasks under
EnterpriseMgmt. When a new join attempt is initiated, the Windows MDM client detects existing enrollment GUIDs and assumes the local device capacity is exhausted or locked, returning error
8018000A.
Diagnostic Verification:
Open PowerShell as Administrator and query local enrollments: Get-ChildItem -Path "HKLM:\SOFTWARE\Microsoft\Enrollments"
If multiple GUID subkeys exist containing values like ProviderID = "MS DM Server" on a machine that claims to be unjoined, orphan registration keys are blocking new setups.Step-by-Step Fix:
1Backup Local Registry Hives:
Open administrative PowerShell and export the Enrollments key for safety: reg export "HKLM\SOFTWARE\Microsoft\Enrollments" "C:\Enrollments_Backup.reg" /y
2Delete Orphaned Enrollment Registry GUIDs:
Open regedit as Administrator and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Enrollments.Expand the key and inspect each GUID subkey.*DO NOT delete the following system keys:* Context, Ownership, Status, or TouchFirst.Delete any long alphanumeric GUID subkeys that contain ProviderID, EnrollmentState, or UPN references.3Remove Orphaned Scheduled Tasks:
Navigate to C:\Windows\System32\Tasks\Microsoft\Windows\EnterpriseMgmt in File Explorer.Delete subfolders matching old enrollment GUIDs.4Reboot Machine and Re-attempt Join:
Restart Windows and initiate the workplace connection via Settings.Prevention & Long-Term Monitoring:
Always use official dsregcmd /leave or Settings GUI options to un-enroll devices prior to re-joining.