Windows activation

Windows activation error 0xC004F042: the specified KMS cannot be used

Error 0xC004F042 means the KMS host the client contacted cannot activate it. Clear the KMS host, set the correct one with slmgr and activate again.

By EpiFive Editorial TeamSources checked How we check our guides

What the error means

Error 0xC004F042 appears when you try to activate a Windows system and the Software Licensing Service decides that the Key Management Service (KMS) it was pointed at cannot be used. In Windows Script Host the message reads that the Software Licensing Service determined that the specified KMS cannot be used. Microsoft's article says the error might occur if you have multiple KMS hosts that activate different sets of KMS clients. The troubleshooting steps apply to physical computers, on-premises virtual machines and Azure virtual machines.

In practice, the KMS client reached a KMS host, but that host is not able to activate the client software. Microsoft calls this common in mixed environments that have application-specific and operating system-specific KMS hosts.

Common causes

  • The KMS client is configured to contact a self-hosted KMS server that does not support the Windows edition installed on the client.
  • The KMS host key does not match the product being activated. Microsoft's example is trying to use a Windows Server 2016 KMS key to activate a Windows Server 2022 client.
  • The client was migrated from an on-premises environment that uses a different KMS infrastructure, so it still points at the old host.

How to fix it

Microsoft's resolution is to make sure the KMS clients connect to the correct hosts. This matters most when specific KMS hosts are used for specific applications or operating systems. The article assumes you are familiar with the slmgr script.

1. Open an administrative Command Prompt

Open a Command Prompt window as administrator on the client that shows the error.

2. Clear the existing KMS host setting

Run the following command to remove any KMS host the client has stored:

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

3. Specify the correct KMS host

Run the following command, replacing the placeholders with the fully qualified domain name (FQDN) of the KMS host and the port that host uses:

cscript c:\windows\system32\slmgr.vbs /skms <KMSHost_fqdn>:<KMSHost_Port>

To activate an Azure VM by using the Azure KMS service, Microsoft says to use azkms.core.windows.net as the host and 1688 as the port.

4. Try to activate again

Run the activation command and check the result:

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

This is a general step: ask your KMS administrator which host is meant to serve this Windows edition before you change the setting, because a wrong host will only produce the same error again.

If nothing works

Confirm with the KMS administrator that the KMS host key supports the Windows version and edition on the client. For Azure virtual machines, Microsoft refers to its pages on troubleshooting Windows activation problems and the troubleshooting tools for Windows activation on Azure VMs. Microsoft also links its general article on Windows activation error codes.

What we checked

One official Microsoft Learn page was read on 2026-11-25: the article on error 0xC004F042 when activating Windows. It gives the message text, the causes, and the slmgr steps. The error was not reproduced for this page.

Last checked: 2026-11-25.

Official sources

Questions people ask

What does error 0xC004F042 mean?

The Software Licensing Service determined that the specified Key Management Service (KMS) cannot be used. The KMS client contacted a KMS host that cannot activate the client software.

Which command sets the KMS host?

Microsoft documents slmgr.vbs with the /skms switch, followed by the host FQDN, a colon and the port. Clear any old setting first with /ckms.

What do I use for an Azure virtual machine?

Microsoft says to use azkms.core.windows.net as the host and 1688 as the port when activating an Azure VM by using the Azure KMS service.

  • 0xC004F038 (Windows activation)

    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.

  • 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.

  • 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.

  • 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.

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.