Windows activation

Windows activation error 0xC004F038: the KMS count is insufficient

Error 0xC004F038 means the KMS host does not have enough computers in its pool. Check the count with slmgr, add clients, or move Azure VMs to Azure KMS.

By EpiFive Editorial TeamSources checked How we check our guides

What the error means

Error 0xC004F038 appears when a Windows system tries to activate against a Key Management Service (KMS) host and the host refuses because its count is too low. Microsoft documents the message as shown in Windows Script Host: the Software Protection Service reported that the computer could not be activated, and the count reported by your Key Management Service (KMS) is insufficient. The message ends by asking you to contact your system administrator.

Microsoft's dedicated article says this typically means that the KMS host does not have enough computers in its KMS pool. It applies to physical computers, on-premises virtual machines and Azure virtual machines, and it appears when a self-hosted KMS host is used to activate Windows. Microsoft's table of activation error codes lists the same message for 0xC004F038 under KMS host errors.

A KMS host only activates clients once it has seen enough unique computers asking for activation. That threshold exists by design, so the error does not mean the product key or the client is faulty. It means the host has not yet counted enough clients.

Common causes

  • A new or small self-hosted KMS host (on-premises or in Azure) has not yet counted enough client computers.
  • For Windows Server-based computers, including VMs, the KMS count is below five.
  • For Windows Client-based computers, including VMs, the KMS count is below 25.
  • An Azure VM has been pointed at a self-hosted KMS host instead of the default Azure KMS endpoint, azkms.core.windows.net. Microsoft notes that VMs using the default endpoint typically do not meet this error.

How to fix it

1. Check the current count on the KMS host

On the KMS host computer, open an administrative Command Prompt and run the command below. Microsoft says to use it to obtain the current count, and you should be familiar with the slmgr script before you continue.

Slmgr.vbs /dli

Compare the count with the thresholds above: at least five for Windows Server and at least 25 for Windows Client.

2. Add unique KMS client computers until the count is reached

Microsoft's first resolution step is to add unique KMS client computers until the count reaches the appropriate threshold. Each client has to be a different computer; repeated requests from the same machine do not raise the count. Then, on the affected KMS client, open an administrative Command Prompt and try activation again:

cscript c:\windows\system32\slmgr.vbs /ato

3. Azure VMs: switch to Azure KMS

If the affected computer is an Azure VM and you do not have to use a self-hosted KMS host, Microsoft says to reconfigure the VM to use Azure KMS. On the VM, open an administrative Command Prompt, set the KMS client setup key that matches your Windows version, and point the VM at the Azure endpoint:

cscript c:\windows\system32\slmgr.vbs /skms azkms.core.windows.net:1688

The setup keys for each Windows version are listed in Microsoft's own documentation. After the KMS endpoint is set, run the activation command from step 2 again.

4. Contact Microsoft Support if it still fails

Microsoft says that if activation fails, you should contact Microsoft Support for assistance, and the same applies to an Azure VM that generates the same error after the switch to Azure KMS. As a general step, collect the output of Slmgr.vbs /dli from the host and the time of the failed activation before you open the case, so the count and the endpoint in use are known.

If nothing works

The error describes the KMS host, so a client-side reinstall or a new key rarely helps. Confirm that the clients really reach the intended KMS host and that the host count rises after each client activates. For Azure VMs, Microsoft's references point to its Azure Windows virtual machine activation troubleshooting pages. See also the entry for 0xC004F074, which covers the case where no KMS host can be contacted at all.

What we checked

Two Microsoft Learn pages were read on 2026-11-24. The dedicated article for 0xC004F038 gives the message, the cause, the KMS count thresholds of five and 25, and the resolution steps for self-hosted KMS hosts and Azure VMs. The Troubleshoot Windows activation error codes article lists the code and message under KMS host errors. The error was not reproduced for this page.

Last checked: 2026-11-24.

Official sources

Questions people ask

What does error 0xC004F038 mean?

Microsoft says it typically means the KMS host does not have enough computers in its KMS pool. The Software Protection Service reports that the count reported by the Key Management Service is insufficient.

How many computers must the KMS host have counted?

Microsoft documents a KMS count of five or more for Windows Server-based computers, including virtual machines, and 25 or more for Windows Client-based computers, including virtual machines.

Do Azure VMs get this error?

Microsoft says Azure VMs that use the default Azure KMS endpoint (azkms.core.windows.net) typically do not, because Azure KMS handles activation counts automatically. A VM pointed at a self-hosted KMS host can still see it.

  • 0xC004F074 (Windows activation)

    Error 0xC004F074 means Windows could not reach a Key Management Service (KMS) host to activate. See the fixes for home PCs and for IT admins running KMS.

  • 0x8007232B (Windows activation)

    Error 0x8007232B means a KMS client could not find the KMS host records in DNS. Fixes for home PCs with the wrong key and for admins troubleshooting KMS DNS.

  • 0x8007232A (Windows activation)

    Error 0x8007232A means Windows could not reach a DNS server to find its KMS host during activation. Steps for physical PCs and Azure VMs, from Microsoft.

  • 0x803F7001 (Windows activation)

    Error 0x803F7001 means Windows could not find a valid license for this PC, often after a hardware change or reinstall. Here is how to reactivate it safely.

Not your code?

Search the error code library, or report a code we don't cover. Spotted something out of date on this page? Report a correction.