TrueschoTruescho
Back to blog

Activate Windows 11 with CMD & PowerShell 2026 — Official slmgr Guide

April 25, 2026mahmoud hussein19 min read
Activate Windows 11 with CMD & PowerShell 2026 — Official slmgr Guide

Step-by-step 2026 guide to activate Windows 11 from CMD and PowerShell using official Microsoft slmgr.vbs commands, GVLK keys, and error fixes.

windows 11 activation
slmgr commands
cmd activation
powershell activation
gvlk keys
kms client setup keys
windows 11 24h2
microsoft volume licensing

Activate Windows 11 with CMD & PowerShell 2026 — Official slmgr Guide

Last updated: April 2026

If you want to activate Windows 11 with CMD and PowerShell the right way in 2026, this is the most complete official guide you will read this year. Instead of relying on shady scripts or random YouTube tutorials, you will learn how to use Microsoft's own slmgr.vbs commands, the official GVLK (Generic Volume License Key) table published on Microsoft Learn, and the PowerShell equivalents that work on Windows 11 23H2, 24H2, and the upcoming 25H1 builds. Whether you are an IT administrator deploying machines for a small Gulf-based startup, a developer who reinstalled Windows after upgrading hardware, or a curious power user who simply wants to understand what slmgr /ipk actually does behind the scenes, this guide gives you a clean, accurate, and legally honest walkthrough — including a frank section on what is and is not allowed under Microsoft's licensing terms.

At a Glance — How to Activate Windows 11 with CMD

To activate Windows 11 from CMD, open Command Prompt as Administrator, run slmgr /ipk <your-25-character-key> to install your product key, then run slmgr /ato to activate online with Microsoft's servers. Verify success with slmgr /xpr. The same flow works in PowerShell. Always use a key that matches your edition (Pro, Home, Enterprise, etc.).

What Is slmgr.vbs and Why Is It Built Into Windows?

slmgr.vbs (Software Licensing Management Tool) is a Visual Basic script that ships with every modern Windows installation, located at C:\Windows\System32\slmgr.vbs. It is the official command-line interface to the Software Licensing service (sppsvc.exe) that handles all activation, key installation, and license verification on Windows. Microsoft has shipped this tool since Windows Vista, and it remains the supported way to script activation in 2026 — even Microsoft's own deployment documentation on Microsoft Learn references it for KMS, MAK, and Retail key scenarios.

When you run a command like slmgr /ipk, the script communicates with the Software Protection Platform (SPP), which then validates your key against Microsoft's licensing database the next time you call /ato. Because slmgr.vbs writes to system-protected areas of the registry and interacts with a privileged service, every command must be executed from an elevated prompt — a regular user-mode CMD will fail silently or throw error 0x80070005 (access denied).

There are two near-identical entry points: slmgr (which calls cscript.exe slmgr.vbs under the hood and prints output via Windows Script Host dialogs) and cscript slmgr.vbs directly (which prints to the console). For automation and SSH scenarios, prefer cscript //nologo slmgr.vbs so output goes to standard output instead of popping up a dialog box.

slmgr is bundled into all editions of Windows 11 — Home, Pro, Pro for Workstations, Pro Education, Education, Enterprise, Enterprise LTSC 2024, and the IoT variants — and works the same on x64, ARM64, and the Insider builds. The behavior is identical across the 23H2 and 24H2 release channels.

Step-by-Step: Activate Windows 11 from CMD in 2026

Follow this sequence exactly. Each step assumes you have a valid product key — either a Retail key you purchased, an OEM key tied to your device, or a GVLK from a properly licensed Volume Activation environment.

Step 1 — Open Command Prompt as Administrator. Press the Windows key, type cmd, right-click "Command Prompt", and choose "Run as administrator". Approve the User Account Control prompt. You should see C:\Windows\System32> in the title bar — if you see your user folder, you are not elevated.

Step 2 — Remove any existing key (optional cleanup). If a previous key is installed and you want a clean slate, run slmgr /upk to uninstall the current product key, then slmgr /cpky to scrub it from the registry. Skip this step if you are activating a fresh install for the first time.

Step 3 — Install your product key. Run slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX, replacing the X's with your actual 25-character key. A success dialog confirms the key was installed. If you see error 0xC004F050, your key is invalid for this edition — double-check that a Pro key is going onto a Pro install, not Home.

Step 4 — Activate online with Microsoft. Run slmgr /ato. This contacts Microsoft's activation servers over HTTPS (port 443). If your firewall blocks outbound HTTPS to activation.sls.microsoft.com, this step will fail with 0x8007232B or 0x8007007B. A successful run shows "Product activated successfully".

Step 5 — Verify activation status. Run slmgr /xpr to see the expiration. For permanently activated Retail and OEM keys, you will see "The machine is permanently activated". For KMS-activated machines (Volume Licensing only), you will see an expiration date 180 days in the future.

Step 6 — Get full license details. Run slmgr /dlv for the verbose license report — it shows your license channel (Retail / OEM / Volume), partial product key, activation ID, and remaining grace period if any. This is the diagnostic command IT pros run before logging support tickets.

If anything fails, jump to the error code table below before re-running. Re-running /ato repeatedly without fixing the underlying cause will not help and may trigger temporary throttling from Microsoft's activation servers.

Complete slmgr Command Reference

Below is every commonly used slmgr switch you should know in 2026. These are documented in Microsoft Learn under "Slmgr.vbs options for volume activation".

CommandWhat It DoesWhen to Use
slmgr /ipk <key>Installs a product keyFirst step of any activation
slmgr /atoActivates Windows onlineAfter installing a Retail or MAK key
slmgr /dliDisplays brief license infoQuick status check
slmgr /dlvDisplays detailed license infoDiagnostics, channel verification
slmgr /xprShows activation expiration dateConfirming KMS renewal or permanent status
slmgr /upkUninstalls the current product keyBefore transferring a key to another machine
slmgr /cpkyRemoves the key from the registryPrivacy / preparing image for cloning
slmgr /rearmResets the activation grace timerSysprep deployment (max ~3 times per install)
slmgr /skms <host:port>Sets a KMS host for activationEnterprise networks with internal KMS
slmgr /ckmsRemoves KMS host settingReverting to public auto-discovery
slmgr /ato <activation-id>Activates a specific subscriptionMicrosoft 365 sub-add-ons
slmgr /skhcEnables KMS host cachingReducing KMS lookups on roaming clients

For a deeper look at when to apply each one in a real deployment, see our companion guide on the Windows 11 Home vs Pro vs Enterprise comparison, which explains why Enterprise editions need different activation flows.

Official Microsoft GVLK Keys for Windows 11 (2026)

GVLKs (Generic Volume License Keys) are publicly published by Microsoft for use with Volume Activation environments — meaning a properly licensed organization running a KMS host or using Active Directory-Based Activation. They are not "free Windows" — they only activate when they can reach a legitimate KMS host owned by an organization with a Volume Licensing agreement. The keys themselves are public information.

Below is the current 2026 table from Microsoft Learn (last refreshed April 2026):

EditionGVLK Key
Windows 11 ProW269N-WFGWX-YVC9B-4J6C9-T83GX
Windows 11 Pro NMH37W-N47XK-V7XM9-C7227-GCQG9
Windows 11 Pro for WorkstationsNRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J
Windows 11 Pro Education6TP4R-GNPTD-KYYHQ-7B7DP-J447Y
Windows 11 EducationNW6C2-QMPVW-D7KKK-3GKT6-VCFB2
Windows 11 EnterpriseNPPR9-FWDCX-D2C8J-H872K-2YT43
Windows 11 Enterprise NDPH2V-TTNVB-4X9Q3-TJR4H-KHJW4
Windows 11 Enterprise LTSC 2024M7XTQ-FN8P6-TTKYV-9D4CC-J462D
Windows IoT Enterprise LTSC 2024KBN8V-HFGQ4-MGXVD-347P6-PDQGT
Windows 11 Pro Workstations N9FNHH-K3HBT-3W4TD-6383H-6XYWF

To use these legally, your machine must reach a KMS host inside an organization with an active Microsoft Volume Licensing agreement. Pointing a GVLK at a public "free KMS" server you found on Google — like the popular kms.msguides.com — is a clear violation of Microsoft's license terms, even if it technically activates for 180 days.

PowerShell Equivalents — A Modern Alternative to slmgr

If you live in PowerShell (and as a Windows 11 admin in 2026, you should), you do not have to leave it just to check activation. The SoftwareLicensingService and SoftwareLicensingProduct WMI/CIM classes give you the same data slmgr /dlv returns, but as objects you can pipe and filter.

To check activation status in PowerShell:

Get-CimInstance -Query "SELECT * FROM SoftwareLicensingProduct WHERE PartialProductKey IS NOT NULL" |
  Select-Object Name, Description, LicenseStatus, PartialProductKey

LicenseStatus = 1 means activated. 0 is unlicensed, 2 is in grace, 3 is out-of-tolerance grace, 4 is non-genuine, 5 is notification mode.

To install a key from PowerShell:

$key = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
$service = Get-CimInstance SoftwareLicensingService
Invoke-CimMethod -InputObject $service -MethodName InstallProductKey -Arguments @{ ProductKey = $key }
Invoke-CimMethod -InputObject $service -MethodName RefreshLicenseStatus

The advantage of PowerShell is scripting — you can deploy a key across hundreds of machines via Intune or Invoke-Command to remote sessions, all from a single line. The disadvantage is verbosity. For one-off troubleshooting on a single PC, plain slmgr from CMD is faster.

Windows Activation Error Codes — 2026 Reference

Error CodeMeaningFix
0xC004C003The activation server determined the key is blockedStop using this key — likely abused / Volume reseller. Buy a fresh Retail key
0xC004F050Product key invalid for this editionVerify Pro key on Pro install, Home key on Home, etc.
0x803F7001No product key found — typically after hardware changeRe-link Microsoft account → Activation Troubleshooter
0xC004E003License validation failedRun sfc /scannow then slmgr /ato again — corrupted SPP files
0xC004F074KMS host could not be contactedCheck DNS for _vlmcs._tcp record, verify KMS host reachable on port 1688
0x8007232BDNS name does not exist (KMS lookup failed)Set explicit KMS with slmgr /skms <host>
0x80070005Access deniedRe-run CMD/PowerShell as Administrator
0x8007007BThe filename, directory, or volume label syntax is incorrectQuote KMS hostname properly, check FQDN

If you keep hitting 0xC004C003 on a key you purchased recently, the seller almost certainly resold a Volume License key that Microsoft has now revoked — see our cheap genuine Windows 11 Pro key buying guide for how to spot these scams before purchase.

What Changed in Windows 11 24H2 for Activation

The 24H2 release (now on the LTSC 2024 servicing branch and rolling out via 25H1 General Availability in early 2026) introduced two changes that affect how activation behaves on home networks:

BitLocker is enabled by default on clean installs with a Microsoft account. This does not change activation directly, but it means that if you swap your motherboard before recording the recovery key, you will lose access to the drive — and the new motherboard will trigger a "hardware significantly changed" re-activation. Always export your BitLocker recovery key from aka.ms/myrecoverykey before any hardware change.

SMB signing is required by default. This breaks legacy KMS hosts running on older Windows Server versions (2012 R2 and earlier) when clients try to pull GVLK metadata over SMB. The fix is to either upgrade the KMS host to Server 2019+ or to enable SMB signing exemptions via Group Policy at Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options > Microsoft network client: Digitally sign communications.

Activation servers now prefer TLS 1.3. If you are activating an old Windows 11 image that was never patched, slmgr /ato may fail with TLS errors. Run Windows Update first, then re-attempt activation.

This section is something every guide should publish but almost none do. Here is an honest 2026 breakdown:

MethodCostLegalityRisk
Retail key from Microsoft Store$199 (Pro)100% legalNone
OEM key with new PCBundled100% legalNone
MAK / Volume key under your org's VL agreementPer agreement100% legalNone
Authorized Amazon reseller (verified)$50–120Legal if seller has rightsLow — verify reseller
Gray-market key sites (Kinguin / G2A / SCDKey)$5–25Murky / often resold Volume keysHigh — keys revoked in 6–12 months
Public KMS server (kms.msguides.com etc.)FreeViolates Microsoft EULAVery high — points GVLK at unauthorized host
KMSPico-style activator scriptsFreeIllegal + EULA violationSevere — 30%+ infected with malware per 2025 Avast report

The practical takeaway: if you are running Windows in a business, on a machine that handles client data, or on your personal device with banking and photos on it, paying $50–199 once is dramatically cheaper than the cost of one ransomware incident from a poisoned activator.

If your watermark keeps coming back after using a sketchy activator, the fix is not another sketchier tool — it is to reinstall cleanly and follow our guide to remove the Activate Windows watermark properly.

E-E-A-T — Real-World Activation Stories

The accounts below are illustrative composites based on common scenarios our team has helped users navigate over the past two years. Names are pseudonyms; details have been combined and lightly edited.

Khalid (Riyadh, IT admin at a 40-person engineering firm). Khalid inherited 18 Windows 11 Pro machines that had all been "activated" by a previous freelancer using an external KMS server. Within four months, every single machine fell back to a non-genuine state simultaneously — Microsoft had revoked the underlying Volume key. Khalid migrated the fleet to legitimate Microsoft 365 Business Premium licenses that include Windows 11 Pro entitlement, used slmgr /ipk with the GVLK and pointed the machines to his Azure AD-Based Activation, and resolved the issue in a single afternoon. Total cost: roughly $22 per user per month, and he now has a clean, audit-passable license trail.

Lina (Cairo, freelance developer). Lina rebuilt her workstation, popped in a new motherboard, and her perfectly legitimate Retail Pro key would not reactivate — error 0x803F7001. She had bought the key directly from Microsoft Store two years earlier but had not linked it to her Microsoft account at purchase time. She opened a Microsoft chat support session, provided the original receipt, and an agent reactivated the key over the phone using slui 4. Lesson: always sign in with your Microsoft account on a new install so the digital license follows the account, not just the hardware.

7 Common slmgr Mistakes to Avoid

  1. Running CMD without "Run as administrator". Every slmgr write command requires elevation. A missing UAC step is the single most common cause of the silent-failure complaint.
  2. Installing a Home key on a Pro install (or vice versa). This throws 0xC004F050. Either reinstall to match, or use slmgr /ipk with the correct Pro key.
  3. Treating slmgr /rearm as infinite. You get a small, finite number of rearms per installation (typically 3 for Windows 11). Burning them on a working install means you cannot reset later.
  4. Using GVLKs without a real KMS host. GVLKs are public, but they only activate against an authorized KMS. Pointing them at random "free KMS" services is an EULA violation.
  5. Forgetting to record the BitLocker recovery key before activating after a hardware swap. A reactivation that triggers BitLocker recovery on a drive you no longer have the key for is an irrecoverable situation.
  6. Trusting Volume keys sold on gray-market sites. Sub-$25 "Pro keys" are almost universally resold Volume keys that Microsoft will eventually revoke.
  7. Skipping slmgr /xpr after activation. If you do not verify, you will not notice that a "successful" activation was actually a 180-day KMS lease that quietly expires later.

FAQ — Activating Windows 11 with CMD

How do I activate Windows 11 from CMD without any third-party software?

Open CMD as Administrator, run slmgr /ipk YOUR-KEY-HERE to install your product key, then slmgr /ato to activate it online with Microsoft. Confirm with slmgr /xpr. No third-party tools, no scripts, no downloads — just the built-in slmgr.vbs script that ships with every Windows 11 install.

What is the difference between slmgr /ipk and slmgr /ato?

slmgr /ipk only installs the product key into the Software Protection service — it does not contact Microsoft. slmgr /ato then sends an activation request to Microsoft's servers using the installed key. You almost always run them as a pair: install the key first, then activate it. Running /ato without first installing a key produces error 0xC004F014.

Can I activate Windows 11 without a product key?

Not legitimately. Windows 11 will install and run in a limited "unactivated" state (with the watermark, restricted personalization, and periodic notifications) without a key, but full activation always requires a valid Retail, OEM, MAK, or KMS-eligible GVLK key. Any "activator" that promises otherwise either pirates the OS or installs malware.

How long does Windows 11 stay activated with a KMS key?

KMS activations last 180 days by default and renew automatically every 7 days as long as the client can reach the KMS host. They are not permanent. A Retail or OEM key, by contrast, activates the machine permanently (until significant hardware changes). Anyone selling "lifetime KMS activation" is misrepresenting how the protocol works.

Why does CMD ask for admin rights to run slmgr?

Because slmgr.vbs writes to the Software Protection Platform (SPP) registry hive and interacts with the privileged sppsvc.exe service. Both are protected system resources. Without elevation, every write call fails with 0x80070005 (access denied). Always launch CMD via right-click → "Run as administrator".

Is using kms.msguides.com or similar public KMS servers safe?

It is technically free and may activate your install for 180 days, but it directly violates Microsoft's licensing terms because GVLKs are licensed only for use against KMS hosts owned by organizations with active Volume Licensing agreements. Beyond legality, you are also handing your machine's identity to an anonymous server you cannot vet.

How do I check if my Windows 11 is permanently activated?

Run slmgr /xpr from an elevated CMD. If you see "The machine is permanently activated" you have a Retail, OEM, or MAK activation. If you see an expiration date roughly 180 days in the future, you are on KMS — that is not permanent, it just renews automatically inside an org network.

What is the GVLK key for Windows 11 Pro in 2026?

The official 2026 GVLK for Windows 11 Pro published on Microsoft Learn is W269N-WFGWX-YVC9B-4J6C9-T83GX. Remember that this key only activates against a properly licensed Volume Activation environment — it is not a "free Pro key" for home users.

Do slmgr commands still work on Windows 11 24H2?

Yes. All slmgr switches documented in this guide work identically on Windows 11 24H2 and the early 25H1 builds. Microsoft has not deprecated slmgr.vbs. The only behavior changes in 24H2 affect TLS versions used for activation requests and SMB signing for KMS host communication — both fixed by keeping Windows fully patched.

Conclusion

Activating Windows 11 from CMD or PowerShell is straightforward when you stick to the official tools: slmgr.vbs for one-off work, the SoftwareLicensingService CIM class for scripting, and a legitimately purchased Retail or OEM key (or a properly licensed Volume key inside an org). The temptation to "save money" with public KMS servers and activator scripts is real, but the math almost never works out — a single malware incident or a revoked key six months in costs more than a Microsoft Store license. Bookmark this guide, save the GVLK table for legitimate Volume scenarios, and keep the error code reference handy the next time slmgr /ato complains.

When you are ready to upgrade your editions or shop legitimately, our companion guides cover the cheapest genuine Windows 11 Pro key sources, a deep dive on Windows 11 editions, how to remove the Activate Windows watermark, and the official way to activate Microsoft Office 365 — all written with the same evidence-first approach.

Sources

  • Microsoft Learn — "Slmgr.vbs options for volume activation": learn.microsoft.com
  • Microsoft Learn — "KMS client setup keys" (GVLK reference, updated April 2026)
  • Microsoft Volume Licensing Service Center — Product Activation guidance
  • Microsoft Tech Community — Windows Activation troubleshooting threads
  • Avast Threat Report 2025 — Bundled malware in pirated Windows activators

For our own original Windows activation walkthrough that complements this guide with offline scenarios, see the Truescho activate-Windows-offline reference. And if you are a student, our GPA calculator and opportunities database help you make the most of every dollar you do not spend on shady keys.


Start Your Journey with Truescho

Whether you're a student looking for scholarships or a professional building skills, truescho.com is your all-in-one platform for education and opportunities. Get Started Free →

mahmoud hussein

mahmoud hussein

Writer at Truescho Blog — We provide trusted content about scholarships, study abroad, and immigration.

Ask on Sada