The issue
The reason for this message is usually that the client believes it is in progress of joining a Azure AD tenant, and therefore refuses your request. This state can be caused by a number of events and reasons…
Error 8018000a: “Something went wrong. The device is already enrolled. You can contact your system administrator with the error code 8018000a.
Pre-checks
Some things to verify before proceesing:
– The device should NOT be in your Intune portal https://portal.azure.com/#blade/Microsoft_Intune_Devices
– Verify that the computer is not in fact joined. Run this command in an elevated prompt: dsregcmd /status
The fix
To troubleshoot this issue I used process monitor and found what Windows does when we try to join Azure AD.
After some testing it showed that if we remove the traces from “ongoing Azure AD join” the wizard will continue and succeed.
You can do this by deleting all GUIDs under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Enrollments
Make sure to NOT delete Context, Ownership, Status and ValidNodePaths.
This can be achieved manually or by the following PowerShell script.
$EnrollmentsPath = "HKLM:\SOFTWARE\Microsoft\Enrollments\"
$Enrollments = Get-ChildItem -Path $EnrollmentsPath
$DiscoveryServerFullUrls = @("https://wip.mam.manage.microsoft.com/Enroll")
Foreach ($Enrollment in $Enrollments) {
$EnrollmentObject = Get-ItemProperty Registry::$Enrollment
if ($EnrollmentObject."DiscoveryServiceFullURL" -in $DiscoveryServerFullUrls ) {
$EnrollmentPath = $EnrollmentsPath + $EnrollmentObject."PSChildName"
Remove-Item -Path $EnrollmentPath -Recurse
& "C:\Windows\System32\deviceenroller.exe /c /AutoEnrollMDM"
}
}
I fixed it
The post is useful
Thank you
2024 and this post is still useful. God bless you.
GOD BLESS
Great, it worked. Thank you!
Wonderfull ! It Works
Thank you. It worked
Ran into this today for a user out of the blue. Worked like a charm. Thank you.
Worked like a treat :)
many thanks
The fix really work
Thanks for the assist
Thank you – I backed up this portion of the registry and then deleted each GUID one by one. No reboot needed, I was able to join immediately after the keys were removed. There were two GUIDS that I could not delete (access denied) but that didn't seem to create any issues.
***THANKS***
worked
worked for me too. THANKS A LOT!!!
Worked for me today and I, too, had two GUIDs that I didn't have permissions to delete. Didn't seem to matter. No reboot needed. THANK YOU!
If anyone has this issue where 2 cant be deleted, simply change ownership of the keys and then youll be able to delete them.
no need, just leave them and join your device
Worked like a charm!
Thank you so much for writing this article – this saved me even in 2024, phew!
Wish Microsoft would get their shit together.
Yes! Still valid on 29th feb
This worked for me! Thank You.
This helped. Thank you for sharing this.
Worked like a charm! Thanks man, saved me time.
Worked for me. Thanks.
Lifesaver!