Windows Autopilot setup steps fails to set up user PIN
Fleet versions
- Discovered: 4.89.0
- Reproduced: 4.89.1
Web browser and operating system: Windows 11
💥 Actual behavior
When setting up a Windows 11 device through Fleet's Autopilot enrollment, it prompts the user to set a PIN, but fails with the error 0x801c0026. Setting up with non-autopilot does not have this issue, so it does appear specific to our Autopilot setup.
🧑💻 Steps to reproduce
These steps:
- [x] Have been confirmed to consistently lead to reproduction in multiple Fleet instances.
- [ ] Describe the workflow that led to the error, but have not yet been reproduced in multiple Fleet instances.
- Set up a fresh Windows 11 device
- On the initial Microsoft sign-in, use an Entra-connected email to start Autopilot enrollment
- When prompted, attempt to set a PIN
⚙️ Workaround
In case any customers need a workaround, the dialog allows the user to "Skip for now" and once they complete setup, they can go into their account settings and set a PIN successfully there.
@thisisjoegrant Did you see this on a restored/cloned VM? Or did you also see this on a physical machine or on a brand new VM created from scratch?
Symptom
During Windows setup (for example, Windows Autopilot), the "Set up a PIN" step fails with "Something went wrong" and error code 0x801C0026. Selecting Try again succeeds. This mostly affects virtual machines (VMs) that are restored from a snapshot or created from a cloned image before each test run.
Cause
0x801C0026 is DSREG_NGC_KEY_ALREADY_EXISTS: Microsoft Entra ID rejected the new Windows Hello key because a key with the same identifier is already registered for the user.
When you set a PIN, Windows creates a new key pair in the device's TPM and registers the public key with Entra ID. On a VM whose virtual TPM state is restored along with the snapshot or image, the TPM starts from the same state each time, so the first key it creates can be identical to a key it created in an earlier run. That key is still registered in Entra ID from the earlier run, so Entra ID rejects it. On retry, the TPM creates a different key, and registration succeeds.
Physical devices aren't affected by this, because their TPM state is never rolled back.
Fleet isn't involved in this step. The PIN prompt appears after the enrollment status page (ESP) completes. The key is created on the device and registered directly with Microsoft Entra ID, and Fleet doesn't send any Windows Hello for Business settings.
Workarounds
- Select Try again (or Skip for now and set the PIN later in Settings). The second attempt creates a new key and succeeds.
- Reset the VM's virtual TPM state when you restore the VM. For example, with QEMU or UTM, recreate the software TPM state instead of keeping it with the snapshot. Each run then starts with a fresh TPM.
- Delete the stale key before each test run:
DELETE https://graph.microsoft.com/v1.0/me/authentication/windowsHelloForBusinessMethods/{id}. This only helps for the next run, because that run registers the same key again.
@getvictor I saw this on both VMs and physical devices. It is worth noting though that since I wrote this bug report, I have redefined what "Autopilot" means. This was seen on NON-Autopilot devices where I selected "Work or School" in the account setup. Sorry for the confusion! The "Try Again" workaround still appears to work for me as of 4.93.0 smoke tests.
@thisisjoegrant I could not repro this on my physical device. Can you repro and then run this script afterwards to gather some data?
# Collects Windows Hello PIN provisioning evidence for 0x801C0026. Run as admin on the affected device soon after the failure.
$since = (Get-Date).AddDays(-2)
$out = Join-Path $env:PUBLIC "pin-0x801c0026-$(Get-Date -Format yyyyMMdd-HHmmss).txt"
& {
"Computer: $env:COMPUTERNAME"
$cs = Get-CimInstance Win32_ComputerSystem
"Model: $($cs.Manufacturer) / $($cs.Model)"
"Boot: $((Get-CimInstance Win32_OperatingSystem).LastBootUpTime.ToUniversalTime().ToString('u'))"
Get-Tpm | Select-Object TpmPresent, TpmReady, ManufacturerIdTxt, ManufacturerVersion | Format-List | Out-String
dsregcmd /status | Select-String 'AzureAdJoined|DeviceId|TenantId|NgcSet|NgcKeyId|PreReqResult'
$logs = 'Microsoft-Windows-User Device Registration/Admin', 'Microsoft-Windows-HelloForBusiness/Operational'
foreach ($log in $logs) {
"===== $log"
Get-WinEvent -FilterHashtable @{ LogName = $log; StartTime = $since } -ErrorAction SilentlyContinue |
Sort-Object TimeCreated |
ForEach-Object { "{0:u} {1} {2}" -f $_.TimeCreated.ToUniversalTime(), $_.Id, ($_.Message -replace '\s+', ' ') }
}
"===== Shell-Core (CloudExperienceHost NGC/Hello)"
Get-WinEvent -FilterHashtable @{ LogName = 'Microsoft-Windows-Shell-Core/Operational'; StartTime = $since } -ErrorAction SilentlyContinue |
Where-Object { $_.Message -match 'NGC|Hello|CXID|ESP' } |
Sort-Object TimeCreated |
ForEach-Object { "{0:u} {1} {2}" -f $_.TimeCreated.ToUniversalTime(), $_.Id, ($_.Message -replace '\s+', ' ') }
} *> $out
"Saved to $out"
@getvictor Well... I tried this morning on both a physical device and a VM and can no longer reproduce it either. Maybe I had a funky setting in an older version that was cleared out? Maybe it was a Windows bug that got patched? I'm not sure, but I think I'm OK with closing this since it is no longer reproducible and I'll just keep an eye out for if this error pops up again in the future.
I've saved your script to my local directory of scripts so I can pull it up and run it if I ever see the error again.
@thisisjoegrant I can document the VM behavior (as expected). So this will just be a documentation bug.
Autopilot flows smooth now users set their PIN with ease trust builds from first step