WindowsPublished on May 28, 20268 min read

Activate a Windows Server license on a VPS: complete guide (2019, 2022, 2025)

On a OuiHeberg Windows VPS, the Windows Server license is included and activated from the start, so Windows Server activation needs nothing from you. This guide shows how to check it with slmgr and in Settings, and what to do if activation drops. For a system activated with your own license, it also covers Retail, MAK and KMS keys, and explains why AVMA does not apply to a VPS.

Check Windows Server activation

Connect to the VPS with Remote Desktop, as described in Connect to a Windows VPS via RDP. Windows labels are quoted in English, the language of the delivered system.

With slmgr

Open PowerShell as administrator and run these two commands.

slmgr.vbs /dli
slmgr.vbs /xpr

/dli opens a window with the edition name, the license channel and its status. The License Status line should read Licensed.

/xpr tells you how long the activation is valid. Depending on the license type, the window shows "The machine is permanently activated" or a volume activation end date that renews on its own. Both answers are normal.

For the full details (activation ID, channel, KMS server in use), run /dlv.

slmgr.vbs /dlv

slmgr answers in a pop-up window. To read the result in the console instead, run it with cscript: cscript //nologo "$env:WINDIR\System32\slmgr.vbs" /dli.

In Settings

  1. Open Settings with Win + I.

  2. Go to System › Activation.

  3. The Activation state line should read Active.

A Windows that is not activated also shows the "Activate Windows" watermark at the bottom right of the desktop, and desktop personalization is locked. An expired evaluation edition also shuts down every hour.


If Windows is no longer activated on your VPS

The included license needs no key from you. If activation drops, do not try to redo it yourself.

  1. Run slmgr.vbs /dli and note the status or error code it shows.

  2. Open a ticket from the client area and attach this result. The steps are at the bottom of this guide.

Do not run slmgr.vbs /upk or install another key on a VPS delivered by OuiHeberg. You would remove the included license.


Choose a key-based activation method

The rest of this guide covers a Windows Server activated with your own license. That means a system you install yourself, or a server at another hosting provider.

SituationMethodActivation
One or a few serversRetail keyOnline or by phone, permanent
A fleet covered by a volume licensing agreementMAK keyOnline, each server uses up one activation of the key
A fleet of at least 5 servers with a KMS serverGVLK key and KMS serverAgainst your KMS server, renewed every 180 days

An OEM key, sold with a physical machine, is not meant for a VPS. Keys found online and tools such as KMSPico are off limits. Microsoft revokes them, and these tools often plant hidden tasks on the server.

What about AVMA?

AVMA (Automatic Virtual Machine Activation) activates the virtual machines of a Hyper-V host running Windows Server Datacenter. According to Microsoft, it does not work with any other virtualization technology. OuiHeberg VPS run on KVM, so AVMA does not apply and an AVMA key activates nothing there.


Activate with a Retail or MAK key

  1. Check the installed edition. A Standard key does not activate a Datacenter edition, and vice versa.

    Get-ComputerInfo | Select-Object WindowsProductName, OsName, OsArchitecture, WindowsEditionId
    
  2. Install the key, replacing the X characters with its 25 characters.

    slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
    
  3. Start online activation. Windows contacts Microsoft's servers and answers "Product activated successfully".

    slmgr.vbs /ato
    
  4. Confirm with slmgr.vbs /xpr. For a Retail or MAK key, the expected answer is "The machine is permanently activated".

Convert an evaluation edition

A Retail key cannot be installed on an evaluation edition. Its name then contains Eval, for example ServerStandardEval. Convert it first with DISM, replacing the target edition with one listed by /Get-TargetEditions.

DISM /online /Get-CurrentEdition
DISM /online /Get-TargetEditions
DISM /online /Set-Edition:ServerStandard /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula

DISM asks for a restart at the end of the conversion. Microsoft notes that an Active Directory domain controller cannot be converted this way.

Activate by phone

Without Internet access, start the phone activation wizard.

slui.exe 4

The wizard shows an installation ID. Call the number shown, then enter the confirmation ID you are given.

What is specific to a MAK key

The procedure is the same as with a Retail key. A MAK key activates a limited number of machines. The Remaining MAK activations line of slmgr.vbs /dlv shows how many are left.

slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
slmgr.vbs /ato
slmgr.vbs /xpr

Each activation is used up for good. A VPS deleted and created again does not give its activation back. If the counter reaches 0, contact your Microsoft reseller. For a fleet that changes often, KMS is a better fit.


Activate Windows Server with a KMS server

A KMS (Key Management Service) server activates the machines on your network. It needs at least 5 servers before it starts activating Windows Server. The KMS server itself is activated with a KMS host key (CSVLK) from your volume licensing agreement.

  1. On the client, install the GVLK key for its edition. The table in the next section lists them all.

    # Windows Server 2022 Standard
    slmgr.vbs /ipk VDYBN-27WPP-V4HQT-9VMD4-VMK7H
    
  2. If the client cannot find the KMS server through DNS, set its address. Port 1688 is the standard KMS port.

    slmgr.vbs /skms kms.example.com:1688
    
  3. Start activation.

    slmgr.vbs /ato
    

To check that the client reaches the KMS server, test the DNS record and the port.

# SRV record published by the KMS server
nslookup -type=srv _vlmcs._tcp.example.com
# KMS port
Test-NetConnection kms.example.com -Port 1688

The client must reach the KMS server at least once every 180 days. Without renewal, its activation expires and Windows goes back to notification mode. This is also how a server moves from a MAK key to KMS: install the GVLK key, point it to the KMS server, then activate.


GVLK keys for Windows Server 2025, 2022 and 2019

These public keys, published by Microsoft, are not licenses. They tell the client which edition to activate against your KMS server. Without a KMS server, they return error 0xC004F074.

EditionGVLK key
Windows Server 2025 StandardTVRH6-WHNXV-R9WG3-9XRFY-MY832
Windows Server 2025 DatacenterD764K-2NDRG-47T6Q-P8T8W-YP6DF
Windows Server 2025 Datacenter Azure EditionXGN3F-F394H-FD2MY-PP6FD-8MCRC
Windows Server 2022 StandardVDYBN-27WPP-V4HQT-9VMD4-VMK7H
Windows Server 2022 DatacenterWX4NM-KYWYW-QJJR4-XV3QB-6VM33
Windows Server 2022 Datacenter Azure EditionNTBV8-9K7Q8-V27C6-M2BTV-KHMXV
Windows Server 2019 StandardN69G4-B89J2-4G8F4-WWYCC-J464C
Windows Server 2019 DatacenterWMDGN-G9PQG-XVVXX-R3X43-63DFG
Windows Server 2019 EssentialsWVDHN-86M7X-466P6-VHXV7-YY726

The full list, including older versions, is in the Microsoft documentation.


Change or uninstall a key

Installed a key for another edition, or a MAK key with no activations left? Remove it, then install the right one with /ipk and activate with /ato.

# Uninstall the current key
slmgr.vbs /upk
# Clear the key from the registry
slmgr.vbs /cpky
# Check
slmgr.vbs /dlv

A Retail or MAK activation survives restarts. Only a KMS activation has to be renewed every 180 days.


Fix activation errors

0xC004F074, no KMS server reachable

Windows cannot find a KMS server, or DNS does not publish it. Test the SRV record and port 1688 with the commands from the KMS section, then set the server address with slmgr.vbs /skms kms.example.com:1688. Also check that at least 5 servers have already contacted the KMS server.

0xC004C003, blocked key

Microsoft's activation server has blocked the key. It was revoked, overused or resold fraudulently. Uninstall it with slmgr.vbs /upk, then buy a key from a Microsoft authorized reseller. If you have just bought it, contact the seller.

0xC004F050, invalid key

The key does not match the system. It is often a typo, a Standard key on a Datacenter edition, or a 2022 key on Windows Server 2025. Check the edition with Get-ComputerInfo | Select WindowsProductName and install the matching key. To change edition, use DISM as for an evaluation edition.

0xC004C060, key refused

The activation server refuses the key. On a VPS, it is often an OEM key tied to a physical machine. Use a Retail key or a volume key (MAK or KMS).

0xC004F009, grace period expired

The time allowed to activate Windows is over and the system is in notification mode. Install a valid key and activate it with /ato.

0x80072EE7, server not found

The server cannot reach Microsoft's activation servers. Test access with Test-NetConnection activation.sls.microsoft.com -Port 443, then check the firewall and proxy. If there is no way through, activate by phone with slui.exe 4.

The server shuts down every hour

An evaluation edition that has run out and is not activated shuts down every hour. Convert and activate it as explained above. To cancel a shutdown already scheduled, run shutdown /a.

"This copy of Windows is not genuine"

Microsoft has invalidated the key. Uninstall it with /upk then /cpky, and install a legitimate key. If a tool such as KMSPico or MSToolkit was used, clean the system: these tools leave scheduled tasks and services behind.

Run a full diagnostic

Paste this script into PowerShell as administrator. It gathers the edition, the activation status, access to Microsoft's servers and the configured KMS server.

# Windows Server activation diagnostic
Write-Host "`n=== Get-ComputerInfo ===" -ForegroundColor Cyan
Get-ComputerInfo | Select-Object WindowsProductName, OsName, OsVersion, OsArchitecture | Format-List
Write-Host "`n=== slmgr /xpr ===" -ForegroundColor Cyan
cscript //nologo "$env:WINDIR\System32\slmgr.vbs" /xpr
Write-Host "`n=== slmgr /dlv ===" -ForegroundColor Cyan
cscript //nologo "$env:WINDIR\System32\slmgr.vbs" /dlv
Write-Host "`n=== activation.sls.microsoft.com:443 ===" -ForegroundColor Cyan
Test-NetConnection activation.sls.microsoft.com -Port 443 | Select-Object ComputerName, RemotePort, TcpTestSucceeded
Write-Host "`n=== KMS ===" -ForegroundColor Cyan
cscript //nologo "$env:WINDIR\System32\slmgr.vbs" /dlv | Select-String "KMS machine name"

On a OuiHeberg VPS, attach this output to your ticket.


Need help?

Open a ticket from Tickets › Open a Ticket, or from the Contact support tile at the bottom of the VPS page. In the Related Service field, pick the VPS so the team saves time. You can also ask your question on the OuiHeberg Discord.

Was this article helpful?

1,007 views
Share this article
Need a Windows VPS?

Windows Server 2025 with the license included, Remote Desktop access and management from the client area.

View plans →

Related Articles