大网数据广告活动
启动与系统组件

Error 0xC004F038 The count reported by your Key Management Service (KMS) is insufficient when activating Windows

· 52CE 我爱测

Discusses how to troubleshoot and resolve error 0xC004F038 ("The count reported by your Key Management Service (KMS) is insufficient"). The steps apply to physical computers, on-premises virtual machines (VMs), and Azure VMs.

This article explains how to resolve error 0xC00F038 (The count reported by your Key Management Service (KMS) is insufficient). This error might appear when you use a self-hosted KMS host to activate Windows. The article reviews the common causes of this issue, and provides steps to resolve them. The troubleshooting steps in this article apply to physical computers, on-premises virtual machines (VMs), and Azure VMs.

Symptoms

When you try to activate a Windows system, you see the following error message in Windows Script Host:

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.

Cause

Typically, this message indicates that the KMS host doesn't have enough computers in its KMS pool.

When you use a self-hosted KMS host (either on-premises or in Azure), you have to have a sufficient number of computers in the KMS pool before you can use the KMS host for activation. The following conditions apply:

  • For Windows Server-based computers (including virtual machines (VMs)), the KMS count must be greater than or equal to five.
  • For Windows Client-based computers (including VMs), the KMS count must be greater than or equal to 25.

Note:
Azure VMs that use the default Azure KMS endpoints (azkms.core.windows.net) typically don't encounter this error because the Azure KMS service handles activation counts automatically.

Resolution

To troubleshoot and fix the issue, follow these steps. To get the best results from these procedures, you should be familiar with the slmgr script.

Step 1: Add computers to the KMS pool

  1. To obtain the current count on the KMS host, run Slmgr.vbs /dli in an administrative Command Prompt window on the KMS host computer.

  2. Add unique KMS client computers until the count reaches the appropriate threshold.

  3. To try again to activate, run the following command in an administrative Command Prompt window on the KMS client:

    cscript c:\windows\system32\slmgr.vbs /ato
    
  4. If the activation fails, take one of the following actions:

    • If the affected computer is an Azure VM, go to step 2.
    • Contact Microsoft Support for assistance.

Step 2 (Azure VMs): Activate by using Azure KMS

By default, Azure VMs should use Azure Key Management Service (KMS) activation. If you don't have to use a self-hosted KMS host, reconfigure Azure VMs to use Azure KMS.

  1. Open an administrative Command Prompt window on the Azure VM.

  2. Set the appropriate KMS client setup key for your Windows version. For example, for Windows Server 2022 Datacenter, run the following command:

    cscript c:\windows\system32\slmgr.vbs /ipk WX4NM-KYWYW-QJJR4-XV3QB-6VM33
    
  3. To configure the Azure VM to use Azure KMS, run the following command:

    cscript c:\windows\system32\slmgr.vbs /skms azkms.core.windows.net:1688
    
  4. To try again to activate, run the following command:

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

If activation fails and generates the same error, contact Microsoft Support for assistance.

References

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
- ✅ Supported versions of Azure Virtual Machine - ✅ Supported versions of Windows Client - ✅ Supported versions of Windows Server · Source date 05/29/2026
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。