Activation fails with 0xC004F038, the KMS count is insufficient, or 0xC004F042, the specified KMS cannot be used? Pool thresholds (5 servers, 25 clients), slmgr /dli, picking the right KMS host, Azure KMS, plus 0xC004F039 and 0xC004F041.
Home › Guides › KMS activation errors 0xC004F038 and 0xC004F042
Last updated 22 November 2026
0xC004F038 means your own KMS host doesn't yet count enough computers to activate anyone: Microsoft requires a KMS count of at least 5 before it activates Windows Server (including VMs) and at least 25 before it activates Windows client computers. Check the count with slmgr.vbs /dli on the KMS host and add unique KMS clients until you pass the threshold. 0xC004F042 means the client reached a KMS host that can't activate the product it runs: a host for another product, a host key that doesn't cover the client's Windows version, or an old KMS setting carried over from another network. Clear the setting with slmgr.vbs /ckms, point the client at the right host with slmgr.vbs /skms and run slmgr.vbs /ato. Azure VMs can skip both problems by using Azure KMS.
Windows Script Host shows this for 0xC004F038:
The Software Protection Service reported that the computer couldn't be activated. The count reported by your Key Management Service (KMS) is insufficient. Please contact your system administrator.
and this for 0xC004F042:
Error: 0xC004F042 The Software Licensing Service determined that the specified Key Management Service (KMS) cannot be used.
Microsoft's error code list words the 0xC004F042 heading as "the specified Key Management Service cannot be read"; the dedicated article and the table in the same list say "cannot be used". Both point to the same error.
All of these show up on a KMS client, but the cause is on the KMS host or in which host the client talks to. Messages are from Microsoft's list of activation error codes.
| Code | Message | Cause | Fix |
|---|---|---|---|
| 0xC004F038 | The count reported by your Key Management Service (KMS) is insufficient | The KMS host has too few computers in its pool (under 5 for Windows Server, under 25 for Windows client) | Add unique KMS clients until the count reaches the threshold, then slmgr.vbs /ato |
| 0xC004F039 | The Key Management Service (KMS) is not enabled | The KMS doesn't respond to the request | Check the network path; make sure no firewall blocks or filters TCP 1688 |
| 0xC004F041 | The Key Management Server (KMS) is not activated. KMS needs to be activated. | The KMS host itself was never activated | Activate the KMS host online or by phone |
| 0xC004F042 | The specified Key Management Service (KMS) cannot be used | The client reached a KMS host that can't activate its software | /ckms, /skms to the correct host, /ato |
If the client can't reach any KMS host at all, you get 0xC004F074 instead; if it can't find one in DNS, 0x8007232B.
A self-hosted KMS host, on-premises or in Azure, only starts activating once enough distinct computers have asked it for activation. Microsoft gives two thresholds:
So a fresh KMS host in a small lab or branch with three servers will answer every request with 0xC004F038 until more machines are pointed at it.
cscript c:\windows\system32\slmgr.vbs /dli
cscript c:\windows\system32\slmgr.vbs /ato
Microsoft notes that Azure VMs using the default Azure KMS endpoint (azkms.core.windows.net) typically don't see this error, because the Azure KMS service handles activation counts itself.
Microsoft says this is common in mixed environments that have application-specific and operating-system-specific KMS hosts, where different hosts activate different sets of clients. The typical scenarios:
Make the client use a host that can activate it:
cscript c:\windows\system32\slmgr.vbs /ckms
cscript c:\windows\system32\slmgr.vbs /skms <KMSHost_fqdn>:<KMSHost_Port>For an Azure VM on Azure KMS, the host is
azkms.core.windows.net and the port is 1688.cscript c:\windows\system32\slmgr.vbs /ato
If the host itself has the wrong key for the clients, fix the host key rather than the clients. Errors about the host key's own activation limit are covered in activation errors 0xC004C003 and 0xC004C008.
Azure VMs should activate against Azure KMS by default. If you don't need a self-hosted KMS host for them, Microsoft's fix for both errors is to reconfigure the VM:
cscript c:\windows\system32\slmgr.vbs /ipk WX4NM-KYWYW-QJJR4-XV3QB-6VM33
cscript c:\windows\system32\slmgr.vbs /skms azkms.core.windows.net:1688
slmgr.vbs /ato. If the same error comes back, contact Microsoft Support.Look up Security-SPP events such as 12288 and 8198 in the Windows Event ID Lookup, copy the slmgr lines from the PowerShell Cheat Sheet, pull the error codes and the KMS count out of slmgr output with the Regex Tester, check which subnets your KMS clients sit in with the IPv4 Subnet Calculator or IPv6 Subnet Calculator, and identify the vendor of a virtual NIC on a migrated VM with the MAC Vendor Lookup. Related guides: KMS activation error 0xC004F074, KMS activation error 0xC004F06C, activation errors 0xC004C003 and 0xC004C008 and common Windows DNS Server and DHCP Server errors.
Windows 10 Enterprise clients on a Windows Server 2012 R2 KMS host fail with 0xC004F015 and 0xc004f042? See activation errors 0xC004F050 to 0xC004F015.
Every Windows activation and KMS error code and event in one place: common Windows activation and KMS errors.
The KMS host does not have enough computers in its pool yet. Microsoft requires a KMS count of at least 5 to activate Windows Server and at least 25 to activate Windows client computers, virtual machines included.
Run cscript c:\windows\system32\slmgr.vbs /dli in an administrative Command Prompt on the KMS host. Add unique KMS clients until the count reaches the threshold, then run slmgr.vbs /ato on the client.
The client contacted a KMS host that cannot activate its software: a host for another product or edition, a host key that does not cover the client version, or a KMS setting left over from another network after a migration.
Clear the KMS setting with slmgr.vbs /ckms, set the correct host with slmgr.vbs /skms followed by the host name and port, and run slmgr.vbs /ato.
Microsoft says Azure VMs that use the default Azure KMS endpoint azkms.core.windows.net typically do not, because Azure KMS handles activation counts. Point the VM at azkms.core.windows.net:1688 with the right KMS client setup key.
Runbooks, checklists and helpdesk templates: IT Admin Packs on Gumroad.