How to Change the Windows Server Activation Mechanism

Cite This Article

Siron, E. (2023, January 22). How to Change the Windows Server Activation Mechanism. Project Runspace, https://projectrunspace.org/how-to-change-the-windows-server-activation-mechanism/

Siron. Eric. "How to Change the Windows Server Activation Mechanism." Project Runspace, 22 Jan. 2023, https://projectrunspace.org/how-to-change-the-windows-server-activation-mechanism/. Accessed unknown.

Siron. Eric. "How to Change the Windows Server Activation Mechanism." Project Runspace. January 22, 2023. https://projectrunspace.org/how-to-change-the-windows-server-activation-mechanism/.

Siron, E. (2023), 'How to Change the Windows Server Activation Mechanism', Project Runspace, 22 January, https://projectrunspace.org/how-to-change-the-windows-server-activation-mechanism/ (Accessed: unknown).

The situation that prompted this article involved a Windows Server Standard Edition virtual machine that was migrated from a Windows Server Datacenter host to a Windows Server Standard Edition host. On the source host, the guest had used Automatic Virtual Machine Activation. That feature only exists on Datacenter Edition, so the virtual machine immediately went into an unactivated state. I switched it to Volume Licensing. However, the method that I used works to change the Windows Server activation mechanism from any mode to any other eligible mode.

What You Need to Change the Windows Server Activation Mechanism

To switch to another Windows Server activation mechanism, you need to have an appropriate license key for that mechanism. This applies to anything except temporarily switching to grace period coverage.

Once you settle on a method, verified the legal status of your licensing situation, and have a key prepared, you can get started.

Note : You could use the activation panes in Windows Server’s “Settings” GUI applet. I will not show that because you can easily find it, and then it’s just a matter of filling in the blanks. However, that only exists on Windows Server with the Desktop Experience. Also, the license activation portion of the Settings applet glitches sometimes and will not allow you to submit a new key. The technique shown in this article always works.

Step 0: Get to the Command Line

All these steps occur at an elevated command prompt (cmd). Alternatively, you can use an elevated PowerShell prompt (powershell). We will work with the “slmgr.vbs” script, which Microsoft builds into every distribution of Windows Server to manage licensing and activation.

At any point, you can run slmgr /dli or slmgr /dlv to view your server’s current licensing status. The dli switch shows simple information, which will usually suffice. The dlv switch retrieves much more. These commands will tell you if the server has activated, the number of days remaining in a grace period, and more. With the dialog box visible and focused, you can press CTRL+C to place its contents on the clipboard.

Step 1: Remove and Clear the Existing Product Key

Unless you intend to go back to a grace period, you do not technically need to clear the existing key. I always follow this step because it takes little effort and ensures a clean transition.

First, run the following command:

slmgr /upk

The UPK switch tells slmgr to uninstall any product key. You should first receive a message that it uninstalled the product key. Next, the tool will prompt for a reboot. I recommend that you reboot before proceeding. You can use shutdown /r /t 0 from the command line to reboot immediately.

Dialog box shown by SLMGR asking for a reboot after uninstalling a Windows Server product key.

After the reboot, expect to see the overlay asking you to activate Windows. If you do not see this, then use the status command from step 0 to see the current state before doing anything else.

Semi-transparent overlay shown on the desktop by Windows when it has not been properly activated

Next, run:

slmgr /cpky

The CPKY switch instructs slmgr to remove surface traces of product keys.

At this point, your server has reverted to its evaluation grace period. If you do not yet have a key to replace the one that you removed, then you can continue like this until the grace period expires. See Step 0 for instructions to view activation status.

Optional Rearm

If you wind up with no grace period, you can “rearm” the activation system.

slmgr /rearm

You can run this a finite number of times to extend the grace period.

Step 2: Enter the New Key

Now it’s time to tell Windows Server about that key you gathered. The following shows the key that I entered to convert my Windows Server 2022 installation to a Standard Edition KMS client:

slmgr /ipk VDYBN-27WPP-V4HQT-9VMD4-VMK7H

If you have proper network connectivity to activate the key that you created, then you could simply wait and the licensing service will eventually reach out to the activation server (or the host, if you used an AVMA key). For the one that I used to work, the system would need to belong to a domain that had the KMS server’s DNS entries in Active Directory. Most of the other key types require the ability to connect to Microsoft’s public licensing servers. OEM keys may activate immediately.

You don’t have to wait. The next section shows how to contact an activation server immediately.

Step 3: Activate Windows Server

The activation command depends on the chosen activation method.

Automatic Online Activation

Windows Server can activate most key types with minimal input, provided that it has enough information to reach the target activation server. AVMA guests will use a local service to talk to the host through SMBus, so they don’t need anything else. Retail and MAK will try to connect to the public Microsoft servers, so your host only needs Internet access. It performs this connection over the standard HTTP and HTTPS ports of 80 and 443, respectively. If your host belongs to an Active Directory domain and the domain’s DNS contains records for a KMS server, then the host will automatically attempt to activate over port 1688. While not covered in this article, you can also use the Volume Activation Management Tool to configure internal proxies for activation.

To activate Windows Server online without waiting for the automatic process, simply enter the following command:

slmgr /ato

After a moment, you will receive a pop-up box that indicates success or failure.

Manually Specify a KMS Host

If the KMS client that you want to activate does not belong to a domain or the directory does not publish KMS information in DNS, then you can tell slmgr how to reach a KMS server. First, you must have entered the appropriate GVLK in step 2. The host to activate must have TCP/IP connectivity to the KMS server over port 1688 (overridable).

Type the following to activate with a specific KMS host:

slmgr /skms KMSSRV

In the above, “KMSSRV” refers to the name of the KMS server. For that to work, the Windows Server installation to activate must know how to resolve that name to the correct IP. You can use DNS or an override in the HOSTS file. Alternatively, you can specify an IP address in place of the host name. However, that only works for IPv4 addresses. The colons in an IPv6 address will confuse slmgr.

If you need to override the port, do so by typing a colon at the end of the host name followed by the port number: slmgr /skms KMSSRV:22700.

You can also activate KMS offline by typing an activation ID after the host and port. The next section covers offline activation.

Offline Activation

You can use the licensing tool for offline activation. This multi-step process requires some back and forth between the host to activate and Microsoft’s activation system. It will not work with generic keys (KMS or AVMA clients). I have seen claims of tools that exist for offline KMS clients, but I do not know of any official support, so beware. The architecture of KMS server allows you to activate its KMS key(s) offline, but the KMS clients need to talk to it. AVMA clients use SMBus and do not need network connectivity. If you have entered KMS/AVMA keys and they don’t work, start over with step 1.

To start the offline activation process, run:

slmgr /dti

This will show a dialog with an Installation ID:

Dialog box of Installation ID provided by slmgr

You’ll need to call Microsoft and provide the displayed Installation ID to get an activation code. If you’re using a MAK or you are installing a KMS key on the KMS server, Microsoft publishes a page with the relevant licensing phone numbers. Alternative ways to get an activation code appear in the next sub-section.

Once you have the activation code, enter it like so:

slmgr /atp ACTIVATIONCODE

The next section shows how to get a key if you need a different phone number.

Alternative Licensing Phone Numbers for Offline Activation

Microsoft does not provide a site with a list of numbers for OEM or retail product keys. You can also use this instead of online activation for a MAK. For this procedure, you’ll need to use a system with the desktop experience. In my case, a Windows 11 system showed the same phone number as a Windows Server 2022 installation.

On a system running the desktop experience, run:

slui 4

That will present a window that asks for your region. Select yours and click Next :

Windows displayed by Windows licensing interface for region selection

You will now see a screen that shows the phone number to dial. When you call the number, it will prompt you for the Installation ID. If you ran the graphical interface on a system other than the one to activate, provide the Installation ID from slmgr on that system as shown in the previous section and click Cancel here. Otherwise, you can continue through this wizard by clicking Enter Confirmation ID.

Windows licensing confirmation ID entry screen

Enter the number provided by the phone system and click Activate Windows.

Monitor Your License Status

Windows Server must verify its activation status every 180 days. If it cannot reach an online public or KMS host, then it switches to reduced-functionality mode and reboots every hour. Servers that can reach the Internet or an internal KMS host should not have problems. AVMA guests on Windows Server Datacenter Edition hosts of the same or a later version should not have trouble, either. If you have a KMS server, check on it routinely, as a KMS host failure will cascade licensing problems throughout your organization. Remember the /dli and /dlv switches from step 0 to check licensing status.

More Fun with SLMGR

This article only showed the most common uses for the SLMGR tool. If you have more complicated needs, such as token-based activation or disjointed domains that you want to auto-discover KMS, Microsoft Learn has a detailed slmgr page.