Error Details
| Fact | Value | Source | Note |
|---|
| Exact error string | MDM enrolment certificate failed — key storage provider returned keyset-does-not-exist error; TPM-based certificate cannot be created during device registration | Windows Event Viewer logs | -> |
| Affected OS build range | Windows 11 22H2 (OS Build 22621.xxx) | Microsoft Intune documentation | -> |
| Registry key involved | HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography | Windows Registry | -> |
| Relevant service/endpoint URL | https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/CertificatesAndKeysPreview | Azure Portal | -> |
| Log line signature | Keyset does not exist: 0x80090016 | Microsoft-Windows-DeviceManagement-Enrollment/Operational logs | -> |
Log Files to Check
C:\Windows\System32\winevt\Logs\Microsoft-Windows-DeviceManagement-Enrollment%4Operational.evtxC:\Windows\System32\winevt\Logs\Application.evtx
What This Error Actually Means
The error code
0x80090016 translates to
2147942422 in decimal and corresponds to the Windows cryptographic error
CRYPT_E_KEYSET_NOT_FOUND. This error indicates that the Key Storage Provider (KSP) responsible for managing TPM-based cryptographic keys cannot locate the required keyset during Microsoft Device Management (MDM) enrollment. The error originates from the Windows Device Management Enrollment service (
dmwappushsvc), which interacts with the TPM-protected key storage to generate device-specific certificates for Intune enrollment. The failure typically occurs when the TPM-backed keyset is either missing, inaccessible, or misconfigured, preventing the creation of a certificate tied to the device's hardware root of trust.
Affected Versions and Scope
This error is specific to **Windows 11 22H2 (OS Build 22621.xxx)** and occurs when devices are configured for **TPM-based certificate enrollment** during Intune MDM registration. It affects tenants that enforce **TPM-backed certificate creation** as part of their device compliance policies or conditional access rules. The issue does **not** occur on:
- Windows 10 or earlier OS versions unless explicitly configured for TPM-based enrollment.
- Devices using software-based certificates (non-TPM-backed).
- Windows 11 22H2 devices where TPM is disabled or not used for certificate generation.
Where To Look First: Logs and Event IDs
The primary log source is
C:\Windows\System32\winevt\Logs\Microsoft-Windows-DeviceManagement-Enrollment%4Operational.evtx. Use the following PowerShell cmdlet to filter relevant events:
Get-WinEvent -LogName "Microsoft-Windows-DeviceManagement-Enrollment/Operational" | Where-Object { $_.Message -match "Keyset does not exist: 0x80090016" }
Key Event IDs to inspect:
- **Event ID 1000**: "MDM enrollment certificate failed — key storage provider returned keyset-does-not-exist error."
- **Event ID 1003**: "TPM-based certificate creation failed due to missing keyset."
Additionally, check
C:\Windows\System32\winevt\Logs\Application.evtx for related cryptographic service errors. Use
dsregcmd /status to verify enrollment state and TPM usage.
Root Causes
1. TPM Not Initialized or Locked
The TPM chip may be disabled in BIOS/UEFI, not activated, or locked due to incorrect ownership. Verify with
Get-Tpm in PowerShell. If
IsActivated or
IsOwned returns
$false, TPM initialization is required.
2. Missing Registry Key for KSP Configuration
The registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography must contain the
KeyStorageProviders subkey with valid TPM provider entries. If missing, the KSP cannot locate the TPM-backed keyset.
3. Incorrect KSP Provider Name
The TPM-based KSP must be explicitly named
Microsoft Platform Crypto Provider in the registry. A mismatch (e.g.,
Microsoft Software Key Storage Provider) forces the system to use a software-based keyset instead of TPM.
4. Permission Denial on Keyset
The device enrollment service (
NT SERVICE\dmwappushsvc) may lack permissions to access the TPM-protected keyset. This is rare but can occur after manual registry modifications or group policy conflicts.
Fix Procedure
- **Verify TPM status**:
Get-Tpm | Select-Object IsActivated, IsOwned, TpmReady
If TpmReady is $false, enable TPM in BIOS/UEFI.
- **Check registry configuration**:
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Cryptography\KeyStorageProviders" | Select-Object *Microsoft*
Ensure Microsoft Platform Crypto Provider exists. If missing, create it with:
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Cryptography\KeyStorageProviders\Microsoft Platform Crypto Provider"
- **Reconfigure KSP via OMA-URI** (for Intune-managed devices):
Deploy the OMA-URI
./Device/Vendor/MSFT/KeyStorageProviders/ProviderName with value Microsoft Platform Crypto Provider.
- **Reset TPM ownership** (use caution):
Resetting TPM ownership will remove all existing TPM-backed keys and break existing MDM enrollments.
Clear-Tpm -AllowClearWithoutActivate
- **Re-enroll device in Intune**:
Use
Remove-MgDeviceManagementManagedDevice -DeviceId $deviceId to delete the device record, then force re-enrollment via dsregcmd /reenroll.
Error Code Variants
| Error Code | Description | Distinguishing Factor |
0x80090016 | Keyset not found | Occurs during TPM-based certificate creation |
0x8009001A | Invalid handle | Related to cryptographic API misuse |
0x8009001F | Bad data | Invalid certificate encoding or signature |
Verification
After applying fixes, verify by:
1. Checking
Microsoft-Windows-DeviceManagement-Enrollment/Operational for Event ID **1004** ("MDM enrollment certificate created successfully").
2. Confirming in the Intune admin center > Devices > All devices that the device shows an enrollment status of **Enrolled**.
3. Using
dsregcmd /status to ensure
MDM and
TPM fields are marked
YES.
Prevention
To prevent recurrence:
- Enforce a baseline policy in Intune > Device configuration > Windows 10/11 > Baseline to ensure TPM is enabled and activated.
- Use PowerShell scripts in device compliance policies to audit registry keys:
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Cryptography\KeyStorageProviders" | Where-Object { $_.PSChildName -ne "Microsoft Platform Crypto Provider" }
- Monitor Azure AD logs via the Azure portal > Azure Active Directory > Monitor > Logs for repeated enrollment failures.
Use Get-MgDeviceManagementManagedDevice -Filter "deviceEnrollmentType eq 'windowsAutoEnrollment'" to proactively identify devices at risk of enrollment failure.