Error Details
| Fact | Value | Source | Note |
|---|---|---|---|
| Error Code | 0x80180019 | DeviceSetup.log | -> Indicates MDM enrollment rejection |
| OS Build Range | Windows 11 22H2 | System Information | -> Affected version |
| Registry Key | HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\MDM | Registry Editor | -> Contains MDM configuration details |
| Relevant Service URL | https://manage.microsoft.com | Intune Admin Portal | -> Access for license assignment |
| Log Line Signature | Enrollment rejected due to missing Intune license or subscription. | DeviceSetup.log | -> Exact error message logged |
Log Files to Check
C:\Windows\System32\winevt\Logs\DeviceSetup.evtxC:\ProgramData\Microsoft\IntuneManagementExtension\LogFiles\IntuneManagementExtension.log
What This Error Actually Means
The error code0x80180019 is a hexadecimal representation of a Windows Device Management (MDM) enrollment failure. Decoding this value, the prefix 0x8018 corresponds to the MDM enrollment subsystem, while 0019 (decimal 25) indicates a licensing validation failure during automatic MDM discovery. This error is raised by the **Windows Device Management Enrollment (DME) service**, which validates Intune licenses and Azure AD tenant subscriptions during device enrollment. The core issue is that the device's MDM enrollment process cannot proceed because the user account lacks an assigned Intune license, or the Azure AD tenant is not properly configured to recognize the Intune subscription. This error is distinct from general enrollment failures and specifically targets licensing gaps in the enrollment workflow.
Affected Versions and Scope
This error occurs in **Windows 11 22H2** (build 22621 or later) when automatic MDM enrollment is attempted. It is not limited to 22H2 but is most commonly observed in this OS version due to stricter license validation during enrollment. The error does **not** affect devices enrolled via manual MDM enrollment (e.g., using thehttps://enroll.manage.microsoft.com portal) or devices using Configuration Manager co-management. It also does not occur in Windows 10 versions prior to 20H2, as the license validation logic in those builds is less granular. Tenants without an active Intune subscription or those with expired licenses are also unaffected, as the error is a direct result of license validation failures.
Where To Look First: Logs and Event IDs
The primary log to investigate isC:\Windows\System32\winevt\Logs\DeviceSetup.evtx, where the error line Enrollment rejected due to missing Intune license or subscription. appears. Use Get-WinEvent -LogName "Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin" -MaxEvents 50 to filter relevant events. Event IDs **1001** and **1002** in the **Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin** log often accompany this error, detailing the license validation failure. Additionally, check C:\ProgramData\Microsoft\IntuneManagementExtension\LogFiles\IntuneManagementExtension.log for OMA-DM protocol errors. Use dsregcmd /status to verify the device's enrollment state and confirm the MDMEnrollmentStatus field. The registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\MDM may also show enrollment failure timestamps.
Root Causes
1. Missing Intune License Assignment
The user account attempting enrollment lacks an assigned Intune license. Verify viaGet-MgUser -UserId $userId | Select-Object AssignedLicenses in Microsoft Graph PowerShell. This cause is confirmed if the user has no INTUNE_A or INTUNE_O365 license in the output.
2. Azure AD Tenant Subscription Mismatch
The Azure AD tenant is not associated with an active Intune subscription. Check viaGet-MgSubscribedSku | Where-Object { $_.SkuPartNumber -like "INTUNE*" }. If no subscription is listed, the error is tenant-level, not user-level.
3. Hybrid Azure AD Join Misconfiguration
In hybrid environments, the device may be Azure AD joined but not properly synced with the cloud tenant. UseGet-ADComputer -Identity $deviceName | Select-Object msDS-cloudExtensionAttributes to validate hybrid join attributes.
Fix Procedure
- Assign the Intune license to the user via
Update-MgUserLicense -UserId $userId -AddLicenses @("INTUNE_A")in Microsoft Graph PowerShell. - Verify tenant subscription via
Get-MgSubscribedSku | Where-Object { $_.SkuPartNumber -eq "INTUNE_A" }. If missing, purchase a license in the Microsoft 365 admin center. - Force license sync using
Invoke-MgGraphRequest -Method POST -Uri "https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/reapplyPolicies". - For hybrid environments, ensure the device is properly joined using the OMA-URI
./Device/Vendor/MSFT/Enrollment/JoinTypewith value2(Azure AD joined). - Restart the enrollment process via
dsregcmd /reenrollafter fixes are applied.
Modifying the
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\MDM registry key manually can break existing MDM enrollment. Only delete the key if the device is unenrolled.Error Code Variants
| Error Code | Description | Distinguishing Factor |
|---|---|---|
0x80180019 | Missing Intune license | License validation failure during enrollment |
0x80180020 | MDM certificate mismatch | Invalid or expired MDM certificate in the device |
0x80180021 | Enrollment URL unreachable | Network connectivity issue to enroll.manage.microsoft.com |
Verification
After applying fixes, checkDeviceSetup.evtx for the log line MDM enrollment succeeded with status 0. Use Get-MgDeviceManagementManagedDevice -Filter "deviceEnrollmentType eq 'windowsAutoEnrollment'" to confirm the device appears in Intune. In the Intune admin center, navigate to Devices > All devices and verify the device's enrollment status is "Enrolled". The dsregcmd /status output should show MDMEnrollmentStatus: 0 and MDMEnrollmentError: 0.
Prevention
Implement a baseline policy in Intune to enforce license assignment via the OMA-URI./User/Vendor/MSFT/Enrollment/LicenseCheck with a required value of INTUNE_A. Use Microsoft Graph PowerShell to automate license assignment with Get-MgUser | Where-Object { $_.AssignedLicenses -notcontains "INTUNE_A" } | Update-MgUserLicense -AddLicenses @("INTUNE_A"). In the Entra admin center, configure Users > Licensing > Assign licenses to enforce license compliance during user provisioning. Regularly audit subscriptions via Get-MgSubscribedSku to ensure no license gaps exist.
Use
dsregcmd /status to quickly diagnose enrollment states without parsing logs. The MDMEnrollmentError field directly maps to the error code.