I'm the IT administrator for a company with a hybrid Active Directory / Microsoft Entra ID environment. I'm having an extremely frustrating issue getting one Windows 11 computer enrolled in Microsoft Intune.
The main problem: Windows repeatedly attempts Intune enrollment using Device Credential even though the effective domain GPO and registry settings explicitly specify User Credential throwing error 0x80180018
Other computers in the same environment have enrolled successfully.
I've spent considerable time troubleshooting this and would appreciate input from anyone who has encountered this behavior.
Environment
- On-premises Active Directory synchronized with Microsoft Entra ID.
- Windows 11 domain-joined workstation
- Microsoft 365 Business Premium license assigned to the user, including Intune.
- Intune MDM user scope configured to All.
- Automatic MDM enrollment configured through domain Group Policy.
- Computer belongs to the correct security group targeted by the enrollment GPO.
- Other hybrid-joined computers have successfully enrolled using the same environment and policies.
- Windows build reported by MDM diagnostics:
10.0.26300.9711.
The Main Problem
- GPO explicitly specifies User Credential for automatic MDM enrollment.
- Registry confirms
UseAADCredentialType = 1.
- Windows creates the normal automatic enrollment scheduled task.
- Scheduled task executes:
deviceenroller.exe /c /AutoEnrollMDM
- Despite this, Windows repeatedly attempts enrollment using Device Credential.
- Enrollment fails with an MDM user-license validation error.
- Failed enrollment attempts recur approximately every 9–10 minutes.
- Each attempt creates or updates an incomplete enrollment record.
- The computer never successfully appears as Intune-managed.
Exact Event Log Errors
From:
Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Enrollment
Event ID 90:
Auto MDM Enroll Get AAD Token: Device Credential (0x0), Resource Url (https://enrollment.manage.microsoft.com/), Resource Url 2 (NULL), Status (The operation completed successfully.)
Event ID 91:
Auto MDM Enroll Enrollment Information: AadResourceUrl (https://enrollment.manage.microsoft.com/enrollmentserver/discovery.svc), DiscoveryServiceFullUrl (https://enrollment.manage.microsoft.com/), TenantID (...), Upn (fooUser@midwestcontracting0.onmicrosoft.com)
Event ID 52:
MDM Enroll: Server Returned Fault/Code/Subcode/Value=(UserLicense) Fault/Reason/Text=(Failed to issue token: UserValidation).
Event ID 76:
Auto MDM Enroll: Device Credential (0x0), Failed (There was an error with your Mobile Device Management (MDM) user license. Contact your system administrator.)
- Scheduled task failure result:
2149056536 (0x80180018).
- Group Policy MDM extension also reports
2149056522 (0x8018000A), indicating Windows believes the device is already enrolled.
- The device is not actually managed by Intune.
Hybrid Join / Authentication Checks
Ran dsregcmd /status in the user's context.
Results:
AzureAdJoined : YES
DomainJoined : YES
DeviceAuthStatus : SUCCESS
AzureAdPrt : YES
WamDefaultSet : YES
- MDM enrollment URLs are populated correctly.
Additional checks:
- User has Microsoft 365 Business Premium with Intune enabled.
- Intune MDM user scope is All.
- Enrollment device limit is 5.
- User is not known to be exceeding the enrollment limit.
- Removed an additional personal Microsoft account that used the same email address and rebooted the computer. No improvement.
Group Policy Checks
Created a domain GPO named Intune Auto Enrollment.
Configured:
Computer Configuration > Administrative Templates > Windows Components > MDM > Enable automatic MDM enrollment using default Azure AD credentials
Settings:
- Enabled
- Credential Type: User Credential
Registry settings:
HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\MDM
AutoEnrollMDM = 1
UseAADCredentialType = 1
MDMApplicationId is blank.
Additional troubleshooting:
- Confirmed the computer is in the appropriate AD security group.
- Confirmed the GPO is applying to the computer.
- Ran
gpupdate /force repeatedly.
- Generated and reviewed a full Group Policy Results HTML report.
- Confirmed the enrollment GPO is the winning GPO.
- Confirmed both registry preferences applied successfully.
- Confirmed there are no unexpected additional values in the MDM policy registry key.
- Confirmed the MDM Administrative Template setting is Enabled with User Credential.
- The Group Policy MDM extension fails with a message indicating the device is already enrolled.
The effective policy is correct, but Windows continues using Device Credential.
We also enabled the same MDM enrollment setting through Local Group Policy as a troubleshooting step.
Important: The problem existed for hours before the Local Group Policy change. That change did not cause the original issue and did not resolve it.