Error Details
| Fact | Value | Source | Note |
|---|
| Exact error string | Device registration failed — duplicate device record or stale hardware hash in Autopilot tenant | Windows logs and Azure portal | -> |
| Affected OS build range | Windows 11 23H2 | Microsoft documentation | -> |
| Registry key involved | HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CloudStorage | Windows Registry Editor | -> |
| Relevant service/endpoint URL | https://portal.azure.com/#blade/Microsoft_Azure_DeviceRegistration/DeviceRegistrationMenuBlade/Devices | Azure Portal | -> |
| Log line signature | [Autopilot] Error 0x801C02F4: Device registration failed — duplicate device record or stale hardware hash in Autopilot tenant | Windows logs (System and Setup) | -> |
Log Files to Check
C:\Windows\Logs\Setup\Autopilot.logC:\Windows\Logs\System\Windows_autopilot_error.log
What This Error Actually Means
The error code
0x801C02F4 is a hexadecimal representation of a Windows Autopilot registration failure. Breaking it down:
- **0x801C** indicates a Microsoft Windows error category (specifically, Windows Device Registration Services).
- **0x02F4** translates to decimal **756**, which maps to a specific failure in the Autopilot device registration workflow.
This error is raised by the **Windows Device Registration Service (DRS)** during the initial enrollment of a Windows 11 23H2 device into an Autopilot tenant. The root issue is a conflict between the device’s hardware hash and the records stored in the Azure Active Directory (AAD) tenant. The hardware hash is a cryptographic signature of the device’s hardware components, used by Autopilot to uniquely identify and provision devices. When this hash conflicts with an existing record (duplicate) or is outdated (stale), registration fails.
Affected Versions and Scope
This error is **exclusive to Windows 11, version 23H2** (build 22000 or later). Earlier OS versions (e.g., Windows 11 21H2 or Windows 10) are unaffected due to differences in Autopilot enrollment workflows and hardware hash generation.
**Tenant configurations at risk**:
- Tenants using **Autopilot with hardware hash-based enrollment** (not serial number or AAD-assigned).
- Environments where devices are reimaged or redeployed without removing stale Autopilot records.
**Not affected**:
- Tenants using **serial number-based enrollment** (as hardware hashes are not required).
- Devices enrolled via **user-driven enrollment** (e.g., AAD join without Autopilot).
Where To Look First: Logs and Event IDs
The primary diagnostic artifacts are:
1. **Log files**:
-
C:\Windows\Logs\Setup\Autopilot.log
-
C:\Windows\Logs\System\Windows_autopilot_error.log
Search for the exact line:
[Autopilot] Error 0x801C02F4: Device registration failed — duplicate device record or stale hardware hash in Autopilot tenant
2. **Event Viewer**:
- **Event ID 10000** in the **System** log: Indicates a device registration failure.
- **Event ID 10001** in the **Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin** log: Provides detailed context about hardware hash mismatches.
3. **Registry key**:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CloudStorage
Check for residual entries under
Autopilot subkeys that may indicate prior enrollment attempts.
Root Causes
1. Duplicate Device Record in Azure AD
A device with the same hardware hash already exists in the tenant. This occurs when a device is reimaged or redeployed without removing the old record.
**How to identify**:
- Run
Get-AutopilotDevice | Where-Object hardwareIdentifier -eq $hash to find duplicates.
- Check the Intune admin center > **Devices > Windows > All devices** for devices with the same hardware hash.
2. Stale Hardware Hash
The device’s hardware has changed (e.g., motherboard replacement), but the Autopilot record was not updated.
**How to identify**:
- Compare the hardware hash in
C:\Windows\Logs\Setup\Autopilot.log with the hash stored in the Intune portal.
- Use
Get-WinEvent -LogName "Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin" -MaxEvents 50 to trace hash mismatches.
3. Corrupted Local Autopilot Cache
The device’s local Autopilot cache contains outdated or conflicting data.
**How to identify**:
- Check
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CloudStorage\Autopilot for inconsistent or expired entries.
Fix Procedure
- **Remove duplicate device records**:
- Navigate to the Azure portal > **Devices > All devices**.
- Delete the stale device entry using
Remove-AutopilotDevice -DeviceId $deviceId.
Warning: Deleting a device in Azure AD will remove its Autopilot profile and enrollment history. Ensure the device is no longer in use.
- **Update hardware hash for changed hardware**:
- Force a new hash generation using PowerShell:
Invoke-MgGraphRequest -Method POST -Uri "https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/$deviceId/renewAutopilotHardwareHash"
- Apply an OMA-URI policy in Intune:
./Device/Vendor/MSFT/Windows/DeviceRegistration/ForceNewHardwareHash
- **Clear local Autopilot cache**:
- Delete the registry key:
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CloudStorage\Autopilot" -Recurse -Force
- Reboot the device to trigger a fresh enrollment.
Error Code Variants
| Error Code |
Description |
Distinguishing Factor |
0x801C02F4 |
Duplicate hardware hash or device record |
Conflicts with existing Autopilot records |
0x801C02F5 |
Invalid or expired Autopilot profile |
Profile mismatch between device and tenant |
0x801C02F3 |
Network connectivity failure during enrollment |
Occurs during initial registration, not hash validation |
Verification
After applying fixes:
- Check
C:\Windows\Logs\Setup\Autopilot.log for the line:
[Autopilot] Success: Device registered with hardware hash $hash
- In the Intune admin center > **Devices > Windows > All devices**, confirm the device appears with the updated hardware hash.
- Run
dsregcmd /status to verify enrollment state:
Device Registered: Yes
Tip: Use Get-MgDeviceManagementManagedDevice -Filter "deviceEnrollmentType eq 'windowsAutoEnrollment'" to list all Autopilot-registered devices and validate uniqueness.
Prevention
To avoid recurrence:
1. **Automate hardware hash renewal**:
- Deploy an Intune policy with OMA-URI
./Device/Vendor/MSFT/Windows/DeviceRegistration/ForceNewHardwareHash on devices with replaceable hardware.
2. **Enforce cleanup policies**:
- Use PowerShell scripts to delete stale Autopilot records:
Get-AutopilotDevice | Where-Object lastModifiedDateTime -lt (Get-Date).AddDays(-30) | Remove-AutopilotDevice
3. **Monitor enrollment logs**:
- Set up Azure Monitor alerts for Event ID 10000 in the System log to detect registration failures proactively.