大网数据广告活动
安装更新与部署

Guidelines for troubleshooting KMS

· 52CE 我爱测

This guide provides information about the KMS service, and suggests tools and approaches for troubleshooting activation issues in Windows Server.

Enterprise customers set up Key Management Service (KMS) as part of their deployment process because it lets them use a simple, straightforward process to activate Windows in their environments. Usually, once you set up the KMS host, the KMS clients connect to the host automatically and activate on their own. However, sometimes the process doesn't work as expected. This article walks you through how to troubleshoot any issues you might encounter.

For more information about event log entries and the slmgr.vbs script, see Volume Activation Technical Reference.

Where to begin troubleshooting KMS

Let’s start with a quick refresher on how KMS activation works. KMS is a client-server model that has some similarities to Dynamic Host Configuration Protocol (DHCP). However, instead of handing out IP addresses to clients on their request, KMS enables product activation. KMS is also a renewal model, in which the clients try to reactivate on a regular interval. There are two roles: the KMS host and the KMS client.

  • The KMS host runs the activation service and enables activation in the environment. To configure a KMS host, you must install KMS key from the Volume License Service Center (VLSC) and then activate the service.
  • The KMS client is the Windows operating system (OS) that you deploy in the environment and need to activate. KMS clients can run any edition of Windows that uses volume activation. The KMS clients come with a preinstalled key, called the Generic Volume License Key (GVLK) or KMS Client Setup Key. The presence of the GVLK is what makes a system a KMS client. The KMS clients use Domain Name System (DNS) SRV records (_vlmcs._tcp) to identify the KMS host. Next, the clients automatically try to discover and use this service to activate themselves. During the 30-day out-of-the-box grace period, they try to activate every two hours. After you activate the KMS clients, they try to renew their activation every seven days.

From a troubleshooting perspective, you might have to look at both the host and client sides to figure out why an issue is happening.

Troubleshooting on the KMS host

When you're examining the KMS host during troubleshooting, there are two areas you should look at:

  • Check the status of the host software license service using the slmgr.vbs command in a command-line prompt.
  • Check the Event Viewer for events related to licensing or activation.

Slmgr.vbs and the Software Licensing service

You can use the slmgr.vbs command-line tool and the Event Viewer to troubleshoot activation issues on KMS clients. To see verbose output from the Software Licensing service, open an elevated Command Prompt window, or PowerShell window, and run slmgr.vbs /dlv. The following screenshot shows the results of this command for the KMS client and KMS host respectively:

KMS client

Here are some variables you should pay attention to in the output while troubleshooting:

  • The Version Information is at the top of the slmgr.vbs /dlv output. The version information is useful for determining whether the service is up-to-date. Making sure everything's up to date is important because the KMS service supports different KMS host keys. You can use this data to evaluate whether or not the version you're currently using supports the KMS host key you're trying to install. For more information about updates, see An update is available for Windows Vista and for Windows Server 2008 to extend KMS activation support for Windows 7 and for Windows Server 2008 R2.

  • The Name indicates which edition of Windows is running on the KMS host system. You can use this information to troubleshoot issues that involve adding or changing the KMS host key. For example, you can use this information to verify if the OS edition supports the key you're trying to use.

  • The Description shows you which key is currently installed. Use this field to verify whether the key that first activated the service was the correct one for the KMS clients you've deployed.

  • The License Status shows the status of the KMS host system. The value should be Licensed. Any other value means you should reactivate the host.

  • The Current Count displays a count between 0 and 50. The count is cumulative between OSs and indicates the number of valid systems that have tried to activate within a 30-day period.

    If the count is 0, either the service was recently activated or no valid clients are connected to the KMS host.

    The count doesn't increase above 50, no matter how many valid systems exist in the environment. The count is set to cache only twice the maximum license policy returned by a KMS client. The maximum policy set by the Windows client OS requires a count of 25 or higher from the KMS host to activate itself. Therefore, the highest count the KMS host can have are either 50 or 2 x 25. In environments that contain only Windows Server KMS clients, the maximum count on the KMS host is 10. This limit is because the threshold for Windows Server editions is 5 (2 x 5 or 10).

    A common issue related to the count happens when the environment has an activated KMS host and enough clients, but the count doesn't increase beyond one. When this issue happens, it means the deployed client image wasn't configured correctly, so the systems don't have unique Client Machine IDs (CMIDs). For more information, see the following articles:

    Another reason why the count might not be increasing is that there are too many KMS hosts in the environment and the count is distributed over all of them.

  • Listening on Port. Communication with KMS uses anonymous RPC. By default, the clients use the 1688 TCP port to connect to the KMS host. Make sure that this port is open between your KMS clients and the KMS host. You can change or configure the port on the KMS host. During their communication, the KMS host sends the port designation to the KMS clients. If you change the port on a KMS client, the port designation is overwritten when that client contacts the host.

We often get asked about the cumulative requests section of the slmgr.vbs /dlv output. Generally, this data isn't helpful for troubleshooting. The KMS host keeps an ongoing record of the state of each KMS client that tries to activate or reactivate. Failed requests indicate the KMS host doesn't support certain KMS clients. For example, if a Windows 7 KMS client tries to activate against a KMS host that was activated by using a Windows Vista KMS key, the activation fails.

The Requests with License Status lines describe all possible license states, both past and present. From a troubleshooting perspective, this data is relevant only if the count isn't increasing as expected. In that case, you should see the number of failed requests increasing. To resolve this issue, you should check the product key that was used to first activate the KMS host system. Also, notice that the cumulative request values reset only if you reinstall the KMS host system.

KMS host

Here are some variables you should pay attention to in the output while troubleshooting:

  • The Name tells you which edition of Windows the system is using. You can use this variable to verify that the version of Windows you're trying to activate is compatible with KMS.

  • The Description shows you which key was installed. For example, VOLUME_KMSCLIENT indicates that the system installed the KMS Client Setup Key, or GVLK, which is the default configuration for volume license media. A system with a GVLK automatically tries to activate by using a KMS host. If you see a different value here, such as MAK, you must reinstall the GVLK to configure this system as a KMS client. You can manually install the key by following the instructions to run slmgr.vbs /ipk <GVLK> in KMS client setup keys, or follow the directions in Volume Activation Management Tool (VAMT) Technical Reference to use the VAMT instead.

  • The Partial Product Key determines whether the KMS Client Setup Key matches the OS the KMS client is using. By default, the correct key is present on systems that are built using media from the Volume License Service Center (VLSC) portal. In some cases, customers might use Multiple Activation Key (MAK) activation until there are enough systems in the environment to support KMS activation. You must install the KMS Client Setup key on these systems to transition them from MAK to KMS. Use VAMT to install this key and make sure you're using the correct key.

  • License Status shows the status of the KMS client system. For a system activated by KMS, this value should be Licensed. Any other value might indicate that there's a problem. For example, if the KMS host is functioning correctly and the KMS client still doesn't activate or is stuck in a Grace state, that means something is preventing the client from reaching the host system. This blockage can be a firewall issue, network outage, and so on.

  • The CMID should be unique in every KMS client that the KMS host is able to activate. The CMID is used by the KMS host to track activation requests from each client. If multiple clients have the same CMID, it can lead to issues with activation tracking and potential problems with license compliance.

  • The KMS Machine Name from DNS shows both the FQDN of the KMS host that the client successfully used for activation and which TCP port it used to communicate.

  • KMS Host Caching shows whether or not caching is enabled. Caching is typically enabled by default. When you enable caching, the KMS client caches the same KMS host that it used for activation and communicates directly with this host instead of querying DNS when it's time to reactivate. If the client can't contact the cached KMS host, it queries DNS to discover a new KMS host.


KMS event IDs

The following sections describe client events that you should be familiar with to help you troubleshoot potential issues more efficiently. When a KMS client successfully activates or reactivates, the client logs event ID 12288 and event ID 12289.

KMS client

Event ID 12288:

The following screenshot showing a segment of an event ID 12288 entry from the KMS event log:

If you see only event ID 12288 without a corresponding event ID 12289, either the KMS client couldn't reach the KMS host, the KMS host didn't respond, or the client didn't receive the host's response. In these cases, you must verify that the KMS host is discoverable and that the KMS clients can contact it.

The most relevant information in event ID 12288 is the data in the Info field. For example, the Info field shows the current state of the client and which FQDN and TCP port the client used when it tried to activate. You can use the FQDN to troubleshoot scenarios where the count on a KMS host doesn't increase. For example, if there are too many KMS hosts available to the clients (either legitimate or unsupported systems), then the count might be distributed over all of them.

An unsuccessful activation doesn't always mean that the client has event ID 12288 and not 12289. A failed activation or reactivation might also have both events. In this case, you have to examine the second event to verify the reason for the failure.

Event ID 12289:

The following screenshot showing a segment of an event ID 12289 entry from the KMS event log:

The Info section of event ID 12289 provides the following information:

  • Activation Flag, which indicates whether the activation succeeded (1) or failed (0).

  • Current Count on the KMS Host, which shows the count value on the KMS host when the client tries to activate. If activation fails, it might be because the count is insufficient for this client OS or that there aren't enough systems in the environment to build the count.

KMS host

Event ID 12290:

The KMS host creates a log labeled Event ID 12290 when a KMS client contacts the host when it's trying to activate. Event ID 12290 contains information you can use to figure out what kind of client contacted the host and why a failure occurred. The following screenshot shows a segment of event ID 12290:

The event details include the following information:

  • The Minimum count needed to activate, which reports that the count from the KMS host must be 5 in order for the client to activate. That means that this OS is a Windows Server OS, although this variable alone doesn't indicate which edition the client is using. If your clients aren't activating, make sure that the host's count allows the client to activate.

  • The CMID, which is a unique value on each system. If this value isn't unique, it's because the image wasn't correctly configured for distribution using sysprep. To learn more about generalizing your computers, see Sysprep (Generalize) a Windows installation. When you encounter this issue, the KMS host count doesn't increase even though there are enough clients in the environment.

  • The License State and Time to State Expiration, which is the current license state of the client. This variable can help you tell whether a client is trying to activate for the first time or if it's trying to reactivate. The time entry can also tell you how long the client remains in that state if nothing else changes.

If you're troubleshooting a client and can't find a corresponding event ID 12290 on the KMS host, then the client isn't connecting to the KMS host. Reasons why the event ID 12290 entry is missing can include:

  • A network outage is encountered.

  • The host isn't resolving or isn't registered in DNS.

  • The firewall is blocking TCP 1688.

    • The port could also be blocked in other places within the environment, including on the KMS host system itself. By default, the KMS host has a firewall exception for KMS, but this exception isn't automatically enabled. To add this exception, run the following command in an elevated PowerShell window:

      New-NetFirewallRule -DisplayName "KMS Host Activation" -Direction Inbound -Protocol TCP -LocalPort 1688 -Action Allow
      New-NetFirewallRule -DisplayName "KMS Host RPC" -Direction Inbound -Protocol TCP -LocalPort 135 -Action Allow
      
  • The event log is full.

Event ID 12293:

Another relevant event to look for on your KMS host is Event ID 12293. This event indicates that the host didn't publish the required records in DNS. This scenario can potentially cause failures, and you should make sure the event isn't there after you set up your host and before you deploy clients. For more information about DNS issues, see Common troubleshooting procedures for KMS and DNS issues.


KMS client renewal requirements

KMS activation operates on a renewal model, where each client device must connect to a KMS host server at least once every 180 days to maintain activation. By default, KMS clients attempt to renew their activation every seven days. When renewal succeeds, the activation validity period resets for another 180 days.

For any reason, if the renewal requirement isn't met, you're prompted with a toast notification 30 days before the 180 days for renewal. The renewal toast notification is also displayed in the activation pane:

Troubleshoot KMS client renewal requirements

  • You receive this notification only if you're on a corporate-owned or managed device. If this is incorrect, obtain a Retail key from the Microsoft Store.

  • If you're using a corporate-owned or managed device, engage with your IT administrator. Here are some possible reasons why you might receive this message:

    • The KMS host is decommissioned: The IT administrator must configure the KMS client version with the KMS Server. Refer to Activate using Key Management Service.

    • Listening on a different port: Communication with the KMS uses anonymous RPC. By default, clients use TCP port 1688 to connect to the KMS host. Ensure this port is open between your KMS clients and the KMS host. You can configure the port on the KMS host through the Windows Firewall with Advanced Security.

    • Verify DNS Configuration: By default, the KMS clients use the automatic discovery process to query DNS for a list of servers. To learn more, see Guidelines for troubleshooting DNS-related activation issues.

What does support ask for?

If your activations aren't working as expected after troubleshooting, you can contact Microsoft Support for technical assistance. The Support Engineer typically asks for the following information:

  • slmgr.vbs /dlv output from the KMS host and KMS client systems.
  • Event logs from both the KMS host (Key Management Service log) and KMS client systems (Application log).

Source: Microsoft Learn / Windows Server documentation by Microsoft and contributors (upstream author metadata: robinharwood). 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 / Windows Server documentation
适用范围
Windows Server · Source date 09/15/2025
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

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

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