KMS Activation Errors 0xC004F038 (Count Is Insufficient) and 0xC004F042 (KMS Cannot Be Used)

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

Quick answer

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.

The messages

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.

KMS host error codes side by side

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.

CodeMessageCauseFix
0xC004F038The count reported by your Key Management Service (KMS) is insufficientThe 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
0xC004F039The Key Management Service (KMS) is not enabledThe KMS doesn't respond to the requestCheck the network path; make sure no firewall blocks or filters TCP 1688
0xC004F041The Key Management Server (KMS) is not activated. KMS needs to be activated.The KMS host itself was never activatedActivate the KMS host online or by phone
0xC004F042The specified Key Management Service (KMS) cannot be usedThe 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.

0xC004F038: the KMS count is too low

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.

  1. On the KMS host, in an administrative Command Prompt, read the current count:
    cscript c:\windows\system32\slmgr.vbs /dli
  2. Point more unique KMS clients at the host until the count reaches the threshold for the clients you want to activate.
  3. On the client, try again:
    cscript c:\windows\system32\slmgr.vbs /ato
  4. If activation still fails and the client is an Azure VM, switch it to Azure KMS (below). Otherwise Microsoft's next step is Microsoft Support.

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.

0xC004F042: the client is talking to the wrong KMS host

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:

  1. Open an administrative Command Prompt on the client.
  2. Clear any KMS host set by hand:
    cscript c:\windows\system32\slmgr.vbs /ckms
  3. Set the correct host and port:
    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.
  4. Activate:
    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: use Azure KMS

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:

  1. Install the KMS client setup key for the VM's Windows version. For Windows Server 2022 Datacenter:
    cscript c:\windows\system32\slmgr.vbs /ipk WX4NM-KYWYW-QJJR4-XV3QB-6VM33
  2. Point it at Azure KMS:
    cscript c:\windows\system32\slmgr.vbs /skms azkms.core.windows.net:1688
  3. Activate with slmgr.vbs /ato. If the same error comes back, contact Microsoft Support.

Related tools and guides

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.

FAQ

What does 0xC004F038 mean?

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.

How do I check the KMS count?

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.

What causes 0xC004F042?

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.

How do I fix 0xC004F042?

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.

Do Azure VMs get 0xC004F038?

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.

Want the full kit?

Runbooks, checklists and helpdesk templates: IT Admin Packs on Gumroad.