Articles on: 🗄️ Virtual & Dedicated Servers
This article is also available in:

How do I activate Windows on a VPS I already have?

If your Windows Server VPS was delivered before automatic activation, it may show "Activate Windows" or "Windows is not activated". When the Windows licence is part of your VPS offer, you activate it once, yourself, in two minutes.


Your VPS keeps its activation by itself afterwards: Windows renews it every 7 days with our activation server. You only do this once.


Before you start


  • You need to log in with an administrator account (the built-in Administrator is fine).
  • Your VPS must keep the IP address we gave it: our activation server only answers our customers' VPS IP addresses.
  • Outgoing connections on TCP port 1688 must not be blocked (they are allowed by default in Windows).


Activate Windows


  1. Connect to your VPS with Remote Desktop.
  2. Right-click the Start button, then choose Terminal (Admin) or Windows PowerShell (Admin).
  3. Copy the whole block below, paste it into the window (right-click pastes), then press Enter.


& {
$kms = 'kms.hodi.cloud'
$keys = @{
'2025ServerStandard' = 'TVRH6-WHNXV-R9WG3-9XRFY-MY832'; '2025ServerDatacenter' = 'D764K-2NDRG-47T6Q-P8T8W-YP6DF'
'2022ServerStandard' = 'VDYBN-27WPP-V4HQT-9VMD4-VMK7H'; '2022ServerDatacenter' = 'WX4NM-KYWYW-QJJR4-XV3QB-6VM33'
'2019ServerStandard' = 'N69G4-B89J2-4G8F4-WWYCC-J464C'; '2019ServerDatacenter' = 'WMDGN-G9PQG-XVVXX-R3X43-63DFG'
'2016ServerStandard' = 'WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY'; '2016ServerDatacenter' = 'CB7KF-BWN84-R7R2Y-793K2-8XDDG'
}
$os = Get-CimInstance Win32_OperatingSystem
$b = [int]$os.BuildNumber
$ver = if ($b -ge 26100) { '2025' } elseif ($b -ge 20348) { '2022' } elseif ($b -ge 17763) { '2019' } elseif ($b -ge 14393) { '2016' }
$ed = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').EditionID
$lic = Get-CimInstance SoftwareLicensingProduct -Filter "ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' AND PartialProductKey IS NOT NULL" | Where-Object { -not $_.LicenseIsAddon } | Select-Object -First 1
if ($os.ProductType -eq 1 -or -not $ver) { Write-Host "Not a supported Windows Server version: $($os.Caption). Contact support." -ForegroundColor Red; return }
if ($ed -like '*Eval') { Write-Host "This is an Evaluation edition ($ed). See 'Evaluation edition' in the article." -ForegroundColor Yellow; return }
if ($lic.LicenseStatus -eq 1 -and $lic.Description -notlike '*VOLUME_KMSCLIENT*') { Write-Host "Windows is already activated with another licence ($($lic.Description)). Nothing to do." -ForegroundColor Green; return }
$key = $keys["$ver$ed"]
if (-not $key) { Write-Host "Edition $ed of Windows Server $ver is not covered. Contact support." -ForegroundColor Red; return }
$slmgr = "$env:windir\System32\slmgr.vbs"
cscript //nologo $slmgr /ipk $key
cscript //nologo $slmgr /skms $kms
cscript //nologo $slmgr /ato
$s = (Get-CimInstance SoftwareLicensingProduct -Filter "ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' AND PartialProductKey IS NOT NULL" | Where-Object { -not $_.LicenseIsAddon } | Select-Object -First 1).LicenseStatus
if ($s -eq 1) { Write-Host "Windows Server $ver is activated." -ForegroundColor Green } else { Write-Host "Not activated yet (status $s). See 'If it does not work'." -ForegroundColor Red }
}


  1. The last line should read, in green, "Windows Server ... is activated." The "Activate Windows" watermark disappears at the next sign-in.


The block only acts on Windows Server 2016 to 2025, Standard or Datacenter. If your Windows is already activated with your own licence, it changes nothing.


If it does not work


  • Error 0x80041008 ("Invalid parameter (SWbemObjectEx)"): this is a bug in Microsoft's November 2026 Windows updates, which breaks activation commands on every server. Restarting does not fix it. Install Microsoft's fix for your version, restart, then run the block again. The fix is not offered by Windows Update: download it from the Microsoft Update Catalog (search for the KB number, take the x64 file named after that KB), then double-click the .msu file.
    • Windows Server 2025: KB5136489
    • Windows Server 2022: KB5136487
    • Windows Server 2019: KB5136490
  • Error 0xC004F074 ("no Key Management Service could be contacted"): our activation server could not be reached from your VPS. Check that your VPS still has the IP address we gave it and that no firewall blocks outgoing TCP 1688, then run the block again. If it persists, contact support with your VPS IP address.
  • "Evaluation edition": your Windows was installed from an evaluation image. It can be converted to the full edition, which needs a restart: contact support and we will do it with you.
  • Your own licence: if you bought your Windows licence elsewhere, do not run this block, and tell us so that it is not counted in your offer.


Have a question?


Contact us by email at technique@hodi.host with your VPS IP address, we will activate it with you.

Updated on: 01/12/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!