总结
本文介绍如何解决错误 0xC004F042 (The Software Licensing Service determined that the specified Key Management Service (KMS) cannot be used.)。 如果有多个激活不同 KMS 客户端集的 KMS 主机,则可能会发生此错误。 本文中的故障排除步骤适用于物理计算机、本地虚拟机(VM)和Azure VM。
症状
尝试激活Windows系统时,Windows脚本主机中看到以下错误消息:
**Error: 0xC004F042** The Software Licensing Service determined that the specified Key Management Service (KMS) cannot be used.
原因
如果 KMS 客户端联系无法激活客户端软件的 KMS 主机,则会发生此错误。 这种情况在同时存在特定于应用程序和特定于操作系统的 KMS 主机的混合环境中很常见。
此错误通常在以下应用场景中出现:
您将 KMS 客户端配置为连接到不支持该客户端上已安装 Windows 版本的自托管 KMS 服务器。
KMS 主机密钥与要激活的产品不匹配(例如,尝试使用 Windows Server 2016 KMS 密钥激活Windows Server 2022客户端)。
从使用不同 KMS 基础结构的本地环境迁移客户端。
决议
若要解决此问题,请确保 KMS 客户端连接到正确的主机。 如果使用特定的 KMS 主机来激活特定应用程序或操作系统,则此因素非常重要。
若要从这些过程获得最佳结果,应熟悉该slmgr脚本。
重要
如果您遇到 Azure 虚拟机 (VM) 的 Windows 激活问题,请参阅 Azure 虚拟机上 Windows 激活问题的故障排除工具。
在客户端上打开管理命令提示符窗口。
若要清除任何现有的 KMS 主机设置,请运行以下命令:
cscript c:\windows\system32\slmgr.vbs /ckms
若要指定用于激活的 KMS 主机,请运行以下命令:
cscript c:\windows\system32\slmgr.vbs /skms
Note
在此命令中,
若要使用 Azure KMS 服务激活 Azure VM,请对 azkms.core.windows.netKMSHost_fqdn< 使用 >,并对 1688KMSHost_Port 使用 <。
若要重试以激活,请运行以下命令:
cscript c:\windows\system32\slmgr.vbs /ato
References
排除Windows激活错误代码
解决 Azure Windows 虚拟机激活问题
用于解决 Azure 虚拟机上 Windows 激活问题的故障排除工具