About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
When a Windows 10 device that is meant to enrol in Intune through Group Policy never appears in the Intune console, and the device's own log shows event 76 with "Auto MDM Enroll: Failed (Unknown Win32 Error code: 0x80180002b)", Microsoft's page says the device was previously joined to a different tenant and did not unjoin from it correctly. Old tenant details are still on the device, and the page says the values used to get a Primary Refresh Token are incorrect.
The fix on the page is to remove the device from both Microsoft Entra ID and the on-premises domain, rejoin it, and sign in again. That is a heavy change for one device, so prove the cause first.
What the error means
Microsoft's page is titled "80180002b error during Windows 10 Group Policy-based auto-enrollment to Intune". It describes two symptoms when you try to enrol a Windows 10 device automatically by Group Policy.
First, Event Viewer logs this event under Applications and Services Logs, Microsoft, Windows, DeviceManagement-Enterprise-Diagnostics-Provider, Admin:
- Log Name: Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin
- Source: DeviceManagement-Enterprise-Diagnostics-Provider
- Event ID: 76
- Level: Error
- Description: Auto MDM Enroll: Failed (Unknown Win32 Error code: 0x80180002b)
Second, when you run dsregcmd /status on the device, AzureAdPrt is NO, "This indicates that the user isn't authenticated to Microsoft Entra ID when signing in to the device." The values of TenantId and AuthCodeUrl are also incorrect.
Microsoft's device-diagnostics page defines the field: AzureAdPrt is set to YES if a Primary Refresh Token (PRT) is present on the device for the signed-in user.
Likely causes
The page gives one cause. The device "was previously joined to a different tenant and didn't unjoin from the tenant correctly." The registry key HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CloudDomainJoin\TenantInfo\<TenantId> still holds the old tenant's information. The AuthCodeUrl and AccessTokenUrl values in those keys are used to get a PRT, and because they are incorrect, AzureAdPrt is NO.
Other things stop automatic enrolment, but they are not this error. Microsoft's Group Policy enrolment page lists requirements: a supported Windows version, an MDM service configured, on-premises Active Directory integrated with Microsoft Entra ID through Microsoft Entra Connect, service connection point configuration, and a device not already enrolled in Intune with the classic agents, which "fail enrollment with error 0x80180026". If the device's TenantId is already your tenant, this error probably has another cause.
Prove the cause before changing anything
All of these only read. Run them on the affected device.
- Confirm the event. In Event Viewer, open the log path above and find event 76 with
0x80180002b. - Run
dsregcmd /statusand noteAzureAdPrt,TenantId,AuthCodeUrl,DeviceId,AzureAdJoinedandDomainJoined. Microsoft's device-diagnostics page says to run it as a domain user account, and that it shows the state of the device in Microsoft Entra ID. - Compare
TenantIdwith your own tenant's ID. If it is a different tenant's, that matches the page's cause. If it is yours andAzureAdPrtis YES, this error probably has a different cause. - Check the registry key above for a
<TenantId>subkey that is not your tenant. The page says the old tenant's values remain there.
Example (illustrative): a laptop at contoso.com.au was used at a previous employer's tenant before purchase and reset without being removed from it. dsregcmd /status shows AzureAdPrt : NO, and TenantId is a GUID that is not Contoso's. The CloudDomainJoin key contains that GUID. The old tenant is still recorded on the device.
Fix
The page's solution has eight steps. Two of them delete the device object from where it is registered, so confirm the device first: if the saved output shows a DeviceId (Microsoft's device-diagnostics page shows that section only for a joined or hybrid joined device), it is the identifier of the object to delete in Microsoft Entra ID, and the computer name is the object to delete from the domain.
Save the dsregcmd /status output to a file before you change anything, because you need DeviceId and the tenant details to pick the right object in Microsoft Entra ID and the domain:
dsregcmd /status > C:\Temp\dsregcmd-before.txt
Disruptive step: the next steps remove one device from the domain and from Microsoft Entra ID and then join it again, and step 4 starts a directory sync cycle for the whole Microsoft Entra tenant, not only for this device. Until it is rejoined, the device is not a member of the domain, so what the domain and Intune apply to it is not applied. Do it for the one device the proof identified, with the user's agreement and at a time they can be without the device, and not for a batch.
- On the affected device, open an elevated Command Prompt window and run
dsregcmd /leave. - Delete the device in Microsoft Entra ID.
- Unjoin the device from your on-premises Active Directory domain, then delete the device object from the domain controller.
- Rejoin the device to the on-premises Active Directory domain, then start a sync cycle from PowerShell:
Start-ADSyncSyncCycle -PolicyType Delta. Microsoft's sync scheduler page confirms that this command runs a manual delta cycle. - Run
dsregcmd /statuson the device and verify that bothAzureAdJoinedandDomainJoinedare YES. - Sign out, then sign in again to get a PRT.
- Run
dsregcmd /statusagain and verify thatAzureAdPrtis YES and the tenant information is correct. - Run
gpupdate /forceto force an update of all Group Policy settings, then verify that the device is enrolled in Intune.
To undo it: removing the device object from Microsoft Entra ID and from the domain cannot be reversed from the saved output; the saved file only records what the device looked like. Rejoining creates a new object. If the unjoin fails partway, the device can be rejoined to the domain with the same name using your normal join process, which the page does not describe.
If the device must keep its domain object for another reason, such as a recorded name or an assigned role, note it before step 3. The page does not say what else the object carries.
Confirm the fix
dsregcmd /statusshowsAzureAdJoined : YES,DomainJoined : YESandAzureAdPrt : YES, with aTenantIdthat is your tenant's.- Event 76 no longer reports
0x80180002bfor new enrolment attempts. - The device appears enrolled in Intune. Microsoft's enrolment page says to check from Start, Settings, Accounts, Access work or school, select the domain account, then Info, which shows the MDM enrolment information.
What to watch afterwards
- Other devices reused from another tenant. The page's cause is a device that did not unjoin correctly, so check the registry key and
TenantIdon any second-hand or transferred device before enrolling it. - A task created by the policy. Microsoft's enrolment page says that when a Group Policy refresh occurs a task is created and scheduled to run every five minutes for one day, named "Schedule created by enrollment client for automatically enrolling in MDM from Microsoft Entra ID". Seeing it run is a sign enrolment is being attempted.
- The Group Policy itself. The page describes "Enable automatic MDM enrollment using default Microsoft Entra credentials", under Computer Configuration, Administrative Templates, Windows Components, MDM.
If the policy itself is missing or misapplied
Microsoft's enrolment page describes how the policy is meant to be deployed, which helps when only some devices fail. You create a Group Policy Object that enables Computer Configuration, Administrative Templates, Windows Components, MDM, "Enable automatic MDM enrollment using default Microsoft Entra credentials", create a security group for the PCs, link the GPO and filter using the security group. If you do not see the policy in the editor, the page says to get the latest ADMX for your Windows version, install the package on a domain controller, copy the PolicyDefinitions folder to the SYSVOL PolicyDefinitions location or your central policy store, and wait for the SYSVOL DFSR replication to complete.
The page also says that in Windows 10, version 1903 and later the policy can use a Device Credential option, supported only for Intune enrolment in co-management or Azure Virtual Desktop multi-session host pools, and that the default behaviour for older releases is User Credential. A device that fails with 0x80180002b has a tenant mismatch; as an inference, a device where the policy never arrives has a Group Policy problem, which is a separate fault.
Read next
Related articles you may want next.
- TroubleshootingGroup Policy Not Applying: gpresult, Events and SYSVOLA Group Policy setting missing on a hosted server: read gpresult as the affected user, check loopback, filter one run's events, then check SYSVOL state.Read article
- TroubleshootingEntra Connect Sync Errors: Duplicate Attributes, Soft and Hard Match ConflictsClassify Entra Connect export errors (AttributeValueMustBeUnique, InvalidSoftMatch, InvalidHardMatch, LargeObject), fix the source object on-premises and verify on the next cycle.Read article
- HostingIdentity for hosted servers: extend your domain, build a new one, or use Entra IDWhich sign-in and directory design suits Windows servers moved to a hosting provider: extending the existing Active Directory domain, building a separate domain, or using Microsoft Entra services, with what each depends on.Read article
Risks and limits
These steps have not been run or lab-tested.
Microsoft's page covers Windows 10 and gives one cause. It does not say how to delete a device in Microsoft Entra ID or from the domain, what happens to BitLocker keys, user profiles or applications, or how to reach the registry key's contents safely. It also does not say which server runs the sync command; Microsoft's scheduler page describes the command only. Do not edit the CloudDomainJoin registry key by hand on the strength of Microsoft's page, which does not give that step.
Sources
- 80180002b error during Windows 10 Group Policy-based auto-enrollment to Intune — Microsoft Learn, page dated 2026-03-30, accessed 1 December 2026
- Troubleshoot devices by using the dsregcmd command — Microsoft Learn, page dated 2025-06-27, accessed 1 December 2026
- Enroll a Windows device automatically using Group Policy — Microsoft Learn, page dated 2025-08-04, accessed 1 December 2026
- Microsoft Entra Connect Sync: Scheduler — Microsoft Learn, page dated 2025-04-09, accessed 1 December 2026
This article was originally published on .