Error Details
| Fact | Value | Source | Note |
|---|---|---|---|
| Exact error string | 0x80180005 (E_FAIL) | OOBE blue error screen | -> indicates Azure AD join or Autopilot enrolment failure |
| Affected build range | Windows 11 23H2 | OS Build | |
| Registry key involved | N/A | -> no specific registry key for this error | |
| Relevant service/endpoint URL | https://graph.microsoft.com/v1.0/users/{user-id}/licenses | Microsoft Graph API | |
| Log line signature | DeviceEnrollment.log contains '80180005' | MDM Diagnostic log |
Log Files to Check
C:\autopilot-diag.cabDeviceEnrollment.log
What This Error Actually Means
The error code 0x80180005 (E_FAIL) is a critical failure that occurs during the Windows Autopilot provisioning process, specifically when attempting to join an Azure Active Directory (Azure AD). This error indicates that there was an issue with either the user's licensing or the device limit imposed by Azure AD. The component responsible for raising this error is the Microsoft Intune service, which interacts with the Azure AD Graph API and enforces license requirements and device quotas.Affected Versions and Scope
This error affects Windows 11 devices running build version 23H2 or later when attempting to enroll through Windows Autopilot. It is particularly relevant in environments where strict licensing controls are enforced, such as large enterprises with centralized management of Microsoft 365 licenses. The error does NOT occur on older builds that do not support the latest features of Intune and Azure AD integration.Where To Look First: Logs and Event IDs
To diagnose this issue, you should first look at the MDM Diagnostic log file located inC:\autopilot-diag.cab. This CAB archive contains detailed diagnostic information about the Autopilot provisioning process. Extract the contents of the cab file to a directory on your local machine and examine the files within.
Additionally, check the DeviceEnrollment.log for specific entries related to this error code. The log line you should be looking for is:
DeviceEnrollment.log contains '80180005'
You can also use PowerShell cmdlets to query relevant logs and events directly from the device or Intune admin center. For example, to retrieve managed devices with Windows Autopilot enrollment type, you can run:
Get-MgDeviceManagementManagedDevice -Filter "deviceEnrollmentType eq 'windowsAutoEnrollment'"
Root Causes
Lack of Required License
One common cause is that the user attempting to sign in during OOBE does not have a valid Microsoft 365 license with Intune capabilities. This can be verified by navigating toMicrosoft 365 admin center > Users > Active users > select the user > Licenses and apps. Ensure that the user has either a standalone Intune license or a bundle including Intune.
Azure AD Device Limit Exceeded
Another cause is reaching the maximum number of devices allowed per user in Azure AD. This can be checked by navigating toEntra admin center > Devices > Device settings > Maximum number of devices per user. If this limit has been reached, you will need to either increase it or remove unused devices from the user's profile.
Mismatched Autopilot Registration
The device serial number might not be correctly registered in the Autopilot enrollment list. This can happen if a hardware hash was incorrectly exported or imported into Intune. To verify, navigate toIntune admin center > Devices > Windows > Windows enrollment > Autopilot devices and search for the device by its serial number.
Fix Procedure
To resolve this issue, follow these steps: 1. **Verify Device Registration:** - Navigate toIntune admin center > Devices > Windows > Windows enrollment > Autopilot devices.
- Search for the device's serial number and ensure it is correctly registered.
2. **Check User License Assignment:**
- Go to Microsoft 365 admin center > Users > Active users > select the user > Licenses and apps.
- Assign or confirm that the required Intune license is toggled on for the user.
3. **Adjust Device Quota Settings:**
- Navigate to Entra admin center > Devices > Device settings > Maximum number of devices per user.
- Increase the limit if necessary, ensuring it allows for additional device enrollments.
4. **Register Hardware Hash (if needed):**
- On the OOBE screen, press Shift+F10 to open a command prompt.
- Run Get-WindowsAutoPilotInfo -OutputFile c:\hash.csv.
- Import this CSV file into Intune admin center > Devices > Autopilot devices > Import.
5. **Review and Apply OMA-URI Settings:**
- Use the following OMA-URI to configure settings related to device enrollment:
./Device/Vendor/MSFT/MDM/WindowsDefenderATP/OnboardingStatus
6. **Reset Device for Retry:**
- If changes are made, reset the device during OOBE by holding down the power button until it restarts.
- Alternatively, use Windows Recovery to perform a full system reset.
Warning: Be cautious when resetting devices as this action will erase all local data and settings. Ensure backups are in place before proceeding.
Error Code Variants
| Error Code | Description | Distinguishing Factors |
|---|---|---|
| 0x80180006 (E_ABORT) | Absence of required license or incorrect user credentials. | This error occurs when the user account does not have sufficient permissions to enroll a device, whereas 0x80180005 is specifically related to licensing and quota limits. |
| 0x80180007 (E_ACCESSDENIED) | User account lacks permissions for the action being performed. | This error indicates a permission issue rather than a licensing or quota problem, which is what 0x80180005 signifies. |
Verification
To verify that the fix has been applied successfully: - Reset the device and initiate OOBE again. - Check if the device can now enroll without encountering error code 0x80180005. - Confirm inIntune admin center > Devices > Windows > Windows enrollment > Autopilot devices that the device is correctly registered under the user's profile.
Prevention
To prevent recurrence of this error, implement proactive measures such as: - Regularly reviewing and updating license assignments inMicrosoft 365 admin center > Users > Active users.
- Monitoring Azure AD device quotas to ensure they are set appropriately for your organization's needs.
- Automating the import of hardware hashes using PowerShell scripts to minimize manual errors during Autopilot registration.
Tips: Use
By following these steps, you can effectively troubleshoot and resolve issues related to error code 0x80180005 in your Windows Autopilot deployment.dsregcmd /status to quickly check the current state of Azure AD enrollment and device licensing on a Windows 10 or later machine.