Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

PowerShell can install a legitimate Windows product key, start an activation attempt, and show the current licensing state. It cannot create a license, bypass activation, or turn an unofficial key into a valid one.

Before starting, make sure you have either a valid 25-character product key or a digital license associated with the computer. If you have a digital license, you normally do not need to enter a key.

Check the installed Windows edition first

A product key must match the edition installed on the computer. For example, a Windows 11 Pro key will not activate Windows 11 Home, and an Enterprise key is not a substitute for a Home or Pro license.

Open PowerShell and run:

Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion, OsBuildNumber

You can also press Windows logo key + R, enter winver, and select OK.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Logitech MK270 Full Size Wireless Keyboard and Mouse Combo - Black
  • Reliable Plug and Play: The USB receiver provides a reliable wireless connection up to 33 ft (1), so you can forget about drop-outs and delays and you can take it wherever you use your computer
  • Type in Comfort: The design of this keyboard creates a comfortable typing experience thanks to the low-profile, quiet keys and standard layout with full-size F-keys, number pad, and arrow keys
  • Durable and Resilient: This full-size wireless keyboard features a spill-resistant design (2), durable keys and sturdy tilt legs with adjustable height
  • Long Battery Life: MK270 combo features a 36-month keyboard and 12-month mouse battery life (3), along with on/off switches allowing you to go months without the hassle of changing batteries
  • Easy to Use: This wireless keyboard and mouse combo features 8 multimedia hotkeys for instant access to the Internet, email, play/pause, and volume so you can easily check out your favorite sites

Check whether Windows is already activated

Before changing the product key, check the activation page in Settings.

  • Windows 11: Start > Settings > System > Activation
  • Windows 10: Start > Settings > Update & Security > Activation

Typical activation messages include Windows is activated, Windows is activated with a digital license, Windows is activated with a digital license linked to your Microsoft account, and Windows is not activated.

Open PowerShell as administrator

Installing a product key and running activation require an elevated PowerShell session.

  1. Open Start and search for PowerShell.
  2. Right-click Windows PowerShell and select Run as administrator.
  3. If Windows 11 opens Windows Terminal instead, choose Run as administrator and use a PowerShell tab.

To confirm that the current window has administrator privileges, run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(
    [Security.Principal.WindowsBuiltInRole]::Administrator
)

The result should be:

True

Activate Windows with a product key

Use this procedure with a legitimately obtained retail, OEM, or MAK key. Replace the placeholder with your own 25-character key.

$ProductKey = 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX'

cscript.exe "$env:SystemRootSystem32slmgr.vbs" /ipk $ProductKey
cscript.exe "$env:SystemRootSystem32slmgr.vbs" /ato

The two commands perform different tasks:

Command Purpose
/ipk Installs or replaces the product key.
/ato Attempts online activation.

cscript.exe runs the Windows Script Host version of slmgr.vbs from PowerShell without depending on the computer’s file association for .vbs files.

Installing a key does not guarantee activation. Windows still checks whether the key is valid, has not been blocked, and applies to the installed edition. A restart is not normally necessary, although restarting Windows or the Software Protection service can help if the licensing state does not update.

Verify activation from PowerShell

Use Slmgr.vbs

Display basic license information:

cscript.exe "$env:SystemRootSystem32slmgr.vbs" /dli

Display detailed licensing information:

cscript.exe "$env:SystemRootSystem32slmgr.vbs" /dlv

Check whether the activation is permanent or has an expiration date:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Amazon Basics Wired QWERTY Keyboard, Works with Windows, Plug and Play, Easy to Use with Media Control, Full-Sized, Black
  • KEYBOARD: The keyboard works for Windows with hot keys that enable easy access to Media, My Computer, Mute, Volume up/down, and Calculator
  • EASY SETUP: Experience simple installation with the USB wired connection
  • VERSATILE COMPATIBILITY: This keyboard is designed to work with multiple Windows versions, including Vista, 7, 8, 10 offering broad compatibility across devices.
  • SLEEK DESIGN: The elegant black color of the wired keyboard complements your tech and decor, adding a stylish and cohesive look to any setup without sacrificing function.
  • FULL-SIZED CONVENIENCE: The standard QWERTY layout of this keyboard set offers a familiar typing experience, ideal for both professional tasks and personal use.
cscript.exe "$env:SystemRootSystem32slmgr.vbs" /xpr

Use /dlv all when the installation contains multiple licensed products:

cscript.exe "$env:SystemRootSystem32slmgr.vbs" /dlv all

These commands may display licensing dialogs rather than return neatly formatted PowerShell objects. That is normal.

Use a native CIM query

To list installed licensing products that have a product key, run:

Get-CimInstance -ClassName SoftwareLicensingProduct |
    Where-Object { $_.PartialProductKey } |
    Select-Object Name, Description, LicenseStatus, PartialProductKey, ID

For Windows licensing, the LicenseStatus values mean:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Value Meaning
0 Unlicensed
1 Licensed
2 Out-of-box grace period
3 Out-of-tolerance grace period
4 Non-genuine grace period
5 Notification

To show only a licensed Windows product:

Get-CimInstance -ClassName SoftwareLicensingProduct |
    Where-Object {
        $_.PartialProductKey -and
        $_.Name -like 'Windows*' -and
        $_.LicenseStatus -eq 1
    } |
    Select-Object Name, Description, PartialProductKey, LicenseStatus

Use PowerShell’s CIM methods instead of Slmgr

PowerShell can invoke the Windows licensing provider directly. This is useful for scripts, although slmgr.vbs is usually simpler to audit and matches Microsoft’s documented activation procedure.

Install a product key through CIM

$ProductKey = 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX'

$LicensingService = Get-CimInstance -ClassName SoftwareLicensingService

Invoke-CimMethod `
    -InputObject $LicensingService `
    -MethodName InstallProductKey `
    -Arguments @{ ProductKey = $ProductKey }

Activate the installed Windows product through CIM

$WindowsProduct = Get-CimInstance -ClassName SoftwareLicensingProduct |
    Where-Object {
        $_.PartialProductKey -and
        $_.Name -like 'Windows*'
    } |
    Select-Object -First 1

Invoke-CimMethod `
    -InputObject $WindowsProduct `
    -MethodName Activate

The Activate method has no parameters. It attempts to activate the selected licensed product using the installed licensing configuration.

Find an embedded OEM key

Some computers have an OEM product key embedded in firmware. To check for it using the modern PowerShell/CIM approach, run:

(Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey

This returns a key only when the firmware exposes one. It will not reveal a retail key, recover a digital license, or generate a license. The older WMIC command often shown in activation guides is deprecated:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
TECKNET Wired Gaming Keyboard, RGB Backlit Keyboard with Metal Panel Design
  • 【Ergonomic Design, Enhanced Typing Experience】Improve your typing experience with our computer keyboard featuring an ergonomic 7-degree input angle and a scientifically designed stepped key layout. The integrated wrist rests maintain a natural hand position, reducing hand fatigue. Constructed with durable ABS plastic keycaps and a robust metal base, this keyboard offers superior tactile feedback and long-lasting durability.
  • 【15-Zone Rainbow Backlit Keyboard】Customize your PC gaming keyboard with 7 illumination modes and 4 brightness levels. Even in low light, easily identify keys for enhanced typing accuracy and efficiency. Choose from 15 RGB color modes to set the perfect ambiance for your typing adventure. After 30 minutes of inactivity, the keyboard will turn off the backlight and enter sleep mode. Press any key or "Fn+PgDn" to wake up the buttons and backlight.
  • 【Whisper Quiet Design】Experience near-silent operation with our whisper-quiet gaming switch, ideal for office environments and gaming setups. The classic volcano switch structure ensures durability and an impressive lifespan of 50 million keystrokes.
  • 【IP32 Spill Resistance】Our quiet gaming keyboard is IP32 spill-resistant, featuring 4 drainage holes in the wrist rest to prevent accidents and keep your game uninterrupted. Cleaning is made easy with the removable key cover.
  • 【25 Anti-Ghost Keys & 12 Multimedia Keys】Enjoy swift and precise responses during games with the RGB gaming keyboard's anti-ghost keys, allowing 25 keys to function simultaneously. Control play, pause, and skip functions directly with the 12 multimedia keys for a seamless gaming experience. (Please note: Multimedia keys are not compatible with Mac)
wmic path SoftwareLicensingService get OA3xOriginalProductKey

Windows Management Instrumentation itself is not deprecated, but WMIC is. Use Get-CimInstance for new scripts.

Activate Windows through Settings

PowerShell is not required if you already have a product key. In Windows 11, open:

Start > Settings > System > Activation > Change product key

Enter the 25-character key and follow the prompts. If the computer has no key or license, the Activation page may show Go to Store. Select it to open Microsoft Store and purchase a Windows license.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Volume licensing and KMS activation

KMS is for organization-managed volume licensing. It is not a consumer activation method. A KMS client normally uses a Generic Volume License Key (GVLK) and contacts the organization’s KMS host through DNS or a configured hostname. Activation is renewed periodically rather than granted as a one-time retail activation.

Only use the following commands if your organization has provided the KMS configuration and client key:

$KmsClientKey = 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX'

cscript.exe "$env:SystemRootSystem32slmgr.vbs" /ipk $KmsClientKey
cscript.exe "$env:SystemRootSystem32slmgr.vbs" /ato

If an administrator has supplied a specific KMS host, configure it and retry:

cscript.exe "$env:SystemRootSystem32slmgr.vbs" /skms kms.example.com:1688
cscript.exe "$env:SystemRootSystem32slmgr.vbs" /ato

TCP port 1688 is the default KMS port. Test connectivity with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Logitech G413 SE Full-Size Mechanical Gaming Keyboard - Black
  • Take your gaming skills to the next level: The Logitech G413 SE is a full-size keyboard with gaming-first features and the durability and performance necessary to compete
  • PBT keycaps: Heat- and wear-resistant, this computer gaming keyboard features the most durable material used in keycap design
  • Tactile mechanical switches: Uncompromising performance is always within reach with this wired gaming keyboard
  • Premium color, material and finish: Elevate your gaming setup with this backlit keyboard featuring a sleek, black-brushed aluminum top case and white LED lighting
  • 6-Key rollover anti-ghosting performance: Experience reliable key input with this anti-ghosting keyboard versus non-gaming mechanical keyboards
Test-NetConnection -ComputerName kms.example.com -Port 1688

A result with TcpTestSucceeded : False indicates that the computer cannot establish a connection to that host and port. Common causes include being off the company network or VPN, DNS failure, a firewall blocking port 1688, or a stopped Software Protection service on the KMS host.

Published GVLKs do not activate retail Windows. They work only when the computer can contact an appropriate KMS host or an authorized Active Directory-based activation service.

Fix common activation errors

Error Likely cause and next step
0x803F7001 Windows could not find a valid license. Use Settings > System > Activation > Change product key, or select Go to Store if you need to purchase a license.
0x800704CF No valid license was found for the device. A valid product key or digital license is required.
0xC004F050 The key is invalid for the attempted activation. Check for typing errors, the installed edition, and the key type.
0xC004F00F The key belongs to another edition, such as Enterprise versus Home or Pro. Use a key matching the installed edition.
0xC004C003 The product key has been blocked. Reinstalling it will not fix the issue; contact the seller or Microsoft Support for a valid replacement.
0xC004F074 A KMS host could not be contacted. Check the organization’s network or VPN, DNS, TCP port 1688, and KMS configuration.
0xC004F038 The KMS host has too few activation clients. Microsoft documents a minimum of 25 Windows client computers or 5 Windows Server computers.
0xC004F211 A significant hardware change, often a motherboard replacement, was detected. If the digital license is linked to a Microsoft account, run the Activation troubleshooter and choose the hardware-change option.

Commands that do not activate Windows

/rearm

/rearm resets activation timers. It does not provide a license or permanently activate Windows:

cscript.exe "$env:SystemRootSystem32slmgr.vbs" /rearm

It is not a replacement for a product key, digital license, MAK, KMS host, or Active Directory-based activation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

/upk

/upk removes the current product key:

cscript.exe "$env:SystemRootSystem32slmgr.vbs" /upk

After a restart, Windows can be left unlicensed unless another valid key is installed. Do not use this as a routine activation step.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Minimal PowerShell activation procedure

For a computer with a valid retail, OEM, or MAK key, run PowerShell as administrator and use:

$ProductKey = 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX'

cscript.exe "$env:SystemRootSystem32slmgr.vbs" /ipk $ProductKey
cscript.exe "$env:SystemRootSystem32slmgr.vbs" /ato
cscript.exe "$env:SystemRootSystem32slmgr.vbs" /xpr

Then confirm the result in:

  • Windows 11: Start > Settings > System > Activation
  • Windows 10: Start > Settings > Update & Security > Activation

If you do not have a valid key, digital license, or authorized volume-activation infrastructure, no PowerShell command can legitimately activate Windows.

FAQ

Can PowerShell activate Windows without a product key?

Only if the computer already has an eligible digital license or authorized volume-activation configuration. PowerShell cannot create a license or bypass activation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
GEODMAER 65% Gaming Keyboard, Wired Backlit Mini Keyboard, Ultra-Compact Anti-Ghosting No-Conflict 68 Keys Membrane Gaming Wired Keyboard for PC Laptop Windows Gamer
  • 【65% Compact Design】GEODMAER Wired gaming keyboard compact mini design, save space on the desktop, novel black & silver gray keycap color matching, separate arrow keys, No numpad, both gaming and office, easy to carry size can be easily put into the backpack
  • 【Wired Connection】Gaming Keybaord connects via a detachable Type-C cable to provide a stable, constant connection and ultra-low input latency, and the keyboard's 26 keys no-conflict, with FN+Win lockable win keys to prevent accidental touches
  • 【Strong Working Life】Wired gaming keyboard has more than 10,000,000+ keystrokes lifespan, each key over UV to prevent fading, has 11 media buttons, 65% small size but fully functional, free up desktop space and increase efficiency
  • 【LED Backlit Keyboard】GEODMAER Wired Gaming Keyboard using the new two-color injection molding key caps, characters transparent luminous, in the dark can also clearly see each key, through the light key can be OF/OFF Backlit, FN + light key can switch backlit mode, always bright / breathing mode, FN + ↑ / ↓ adjust the brightness increase / decrease, FN + ← / → adjust the breathing frequency slow / fast
  • 【Ergonomics & Mechanical Feel Keyboard】The ergonomically designed keycap height maintains the comfort for long time use, protects the wrist, and the mechanical feeling brought by the imitation mechanical technology when using it, an excellent mechanical feeling that can be enjoyed without the high price, and also a quiet membrane gaming keyboard

Do I need to run PowerShell as administrator?

Yes for installing a product key and performing activation. The administrator check should return True.

Why did installing the key not activate Windows?

The key may be invalid, blocked, intended for another Windows edition, or unable to reach the applicable activation service. Check the error code returned by /ato and confirm the edition with Get-ComputerInfo.

Can a Windows 11 Pro key activate Windows 11 Home?

No. The key must match the installed edition. A Home installation must be upgraded or reinstalled appropriately before a Pro license can be used.

Does /rearm permanently activate Windows?

No. It resets activation timers and does not supply a license. It should not be presented as an activation solution.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What is the difference between a digital license and a product key?

A product key is a 25-character code entered during activation. A digital license is an entitlement associated with the device, and activation normally occurs without entering a key.

Can I use a KMS key on a personal retail copy of Windows?

No. KMS client keys are for organization-managed volume licensing and require access to an authorized KMS host or Active Directory-based activation service.

The Bottom Line

For a legitimate key, run PowerShell as administrator, install it with slmgr.vbs /ipk, start activation with slmgr.vbs /ato, and verify the result with /xpr or the Activation page in Settings. If the computer uses a digital license, sign in with the associated Microsoft account and use the Activation troubleshooter when necessary. Without a valid license or authorized volume-activation service, PowerShell cannot legitimately activate Windows.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.