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

You can activate Windows 11 from an elevated PowerShell window with the built-in slmgr.vbs licensing script. PowerShell does not create a license: activation still requires either a valid 25-character product key or a digital license associated with the device.

For a normal retail installation, install the key with /ipk, then request online activation with /ato. If the PC already has a digital license for the same Windows edition, activation normally happens automatically after it connects to the internet, so PowerShell may not be necessary.

Before activating Windows 11 with PowerShell

Check that you have the correct license and edition. A Windows 11 Home license cannot activate Windows 11 Pro, and an Enterprise license is not a valid license for Home or Pro. A first activation on a device or motherboard that has never had an activated Windows 11 installation also requires a valid license.

To check the installed edition, open Settings > System > About and look under Windows specifications. To check the current activation state, go to Start > Settings > System > Activation. The page may report:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Logitech M185 Compact Ambidextrous Wireless Mouse with Rubber Grips - Blue
  • Compact Mouse: With a comfortable and contoured shape, this Logitech ambidextrous wireless mouse feels great in either right or left hand and is far superior to a touchpad
  • Durable and Reliable: This USB wireless mouse features a line-by-line scroll wheel, up to 1 year of battery life (2) thanks to a smart sleep mode function, and comes with the included AA battery
  • Universal Compatibility: Your Logitech mouse works with your Windows PC, Mac, or laptop, so no matter what type of computer you own today or buy tomorrow your mouse will be compatible
  • Plug and Play Simplicity: Just plug in the tiny nano USB receiver and start working in seconds with a strong, reliable connection to your wireless computer mouse up to 33 feet / 10 m (5)
  • Better than touchpad: Get more done by adding M185 to your laptop; according to a recent study, laptop users who chose this mouse over a touchpad were 50% more productive (3) and worked 30% faster (4)
  • Windows is activated with a digital license
  • Windows is activated with a digital license linked to your Microsoft account

If you have a product key, it should use this format:

XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

Do not rely on websites offering “generic” or “free activation” keys. A key must be valid, apply to the installed edition, and be permitted under the relevant licensing terms. PowerShell cannot legitimately activate Windows without a digital license or valid product key.

Open PowerShell as administrator

  1. Open Start and search for PowerShell.
  2. Right-click Windows PowerShell or PowerShell and select Run as administrator.
  3. Select Yes when User Account Control asks for permission.

The commands below call slmgr.vbs through cscript.exe. This format works from PowerShell and avoids relying on a graphical dialog.

Activate Windows 11 with a product key

Replace the example key with your own valid 25-character key. Run these commands separately in the elevated PowerShell window:

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

cscript.exe “$env:SystemRoot\System32\slmgr.vbs” /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

cscript.exe “$env:SystemRoot\System32\slmgr.vbs” /ato

The first command, /ipk, installs or replaces the installed product key. Windows checks whether the key applies to the installed operating system. The second command, /ato, requests online activation for a retail edition or for a volume installation using an appropriate KMS host key or MAK.

Rank #2
Sale
Logitech M240 Compact Silent Bluetooth Wireless Mouse - Graphite
  • Pair and Play: With fast, easy Bluetooth wireless technology, you’re connected in seconds to this quiet cordless mouse —no dongle or port required
  • Less Noise, More Focus: Silent mouse with 90% reduced click sound and the same click feel, eliminating noise and distractions for you and others around you (1)
  • Long-Lasting Battery Life: Up to 18-month battery life with an energy-efficient auto sleep feature, so you can go longer between battery changes (2)
  • Comfortable, Travel-Friendly Design: Small enough to toss in a bag; this slim and ambidextrous portable compact mouse guides either your right or left hand into a natural position
  • Long-Range: Reliable, long-range Bluetooth wireless mouse works up to 10m/33 feet away from your computer (3)

Windows may display a Windows Script Host message after each command. A successful result should state that the product key was installed and that the product was activated successfully. If the key was already installed, running /ipk with a different valid, applicable key replaces it.

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

Restart after changing the key

Microsoft recommends restarting Windows or restarting the Software Protection Service after changing the product key. A restart is the simplest option:

Restart-Computer

Save your work before running it. You can then check activation again with the commands below or at Settings > System > Activation.

Check Windows 11 activation from PowerShell

Use these commands in an elevated PowerShell window:

Command What it shows
cscript.exe “$env:SystemRoot\System32\slmgr.vbs” /dli Basic license information
cscript.exe “$env:SystemRoot\System32\slmgr.vbs” /dlv Detailed license information, including licensing status and channel
cscript.exe “$env:SystemRoot\System32\slmgr.vbs” /xpr The activation expiration date

/xpr is particularly useful for KMS clients. Retail and MAK activation is normally perpetual, so those installations generally do not show a recurring expiration date.

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.

To inspect every installed activation ID, run:

cscript.exe “$env:SystemRoot\System32\slmgr.vbs” /dlv all

The returned activation IDs can be supplied to commands such as /ato, /dli, /dlv, and /xpr when a computer contains more than one installed edition or licensing record.

Rank #3
Afaartcci Rechargeable Wireless Mouse, Silent Bluetooth Mouse (Black)
  • 【Dual Mode Wireless Bluetooth Mouse】: Switch easily between two devices—connect one via Bluetooth (BT5.2/3.0) and the other using a 2.4G USB receiver. No drivers needed; just plug and play. Enjoy a reliable connection up to 33 feet. Note: You can't use both modes simultaneously; the USB receiver is stored in the mouse.
  • 【Rechargeable Wireless Mouse】: Equipped with a 500mAh lithium-ion battery, it charges in 2 hours for over 7 days of use and 30 days on standby. The mouse sleeps after 5 minutes of inactivity to save power and can be woken with any click.
  • 【Colorful LED Breathing Light】: Features 7 colorful LED lights that change randomly, adding a fun atmosphere to your workspace.
  • 【Portable Mouse】Compact size (4.4 x 2.3 x 1.1 inches) makes it easy to fit in your laptop bag. Lightweight and ergonomic, it's perfect for travel. Contact us anytime for support.
  • 【Wide Compatibility】: Works with laptops, PCs, tablets, and smartphones across various operating systems, including Android, Windows, and Mac. Ideal for home, office, and travel.

Activate a Windows 11 digital license

A digital license normally does not require a PowerShell activation command. If the device previously had an activated copy of the same Windows 11 edition, reinstall Windows, connect to the internet, and sign in with the Microsoft account linked to the license. Windows should normally reactivate automatically.

Check the result at Start > Settings > System > Activation. If the device is not activated, select Troubleshoot. Windows 11 opens the automated Activation troubleshooter in the Get Help app.

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

A motherboard replacement or another significant hardware change can invalidate activation. If the digital license was linked to your Microsoft account before the change, the troubleshooter may offer a supported reactivation path. It cannot provide a license for a different edition: hardware previously licensed only for Home still needs a valid Pro license if Windows 11 Pro is installed.

Fix common PowerShell activation errors

Error Likely cause and action
0xC004F210, 0xC004E016, or 0xC004F00F The key and installed edition do not match. Confirm whether Windows 11 Home, Pro, or an Enterprise edition is installed, then use a license for that edition.
0xC004FC03 Windows cannot complete online activation because the device is offline or firewall settings are interfering. Check the connection and firewall, then run /ato again.
0x8007267C No internet connection is available, or the activation server is temporarily unavailable. Connect the PC and retry later.
0xC004E028 An activation request is already in progress. Wait for the first request to finish instead of repeatedly running /ato.
0xC004C008, 0xC004C770, or 0x803FA071 The key has been used on too many devices. A separate valid license may be required for this PC.
0x8007232B, 0xC004F074, 0xC004F038, or 0x8007007B This usually indicates a volume-licensed or KMS installation that cannot reach the organization’s licensing infrastructure, or that the wrong edition is installed.

KMS activation commands for organization-managed PCs

Do not use KMS commands for a normal personal retail installation. They are appropriate only when an organization has supplied a KMS host or volume-activation configuration.

If your administrator has provided a KMS host, set it and request activation with:

cscript.exe “$env:SystemRoot\System32\slmgr.vbs” /skms kms.example.com:1688

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.

cscript.exe “$env:SystemRoot\System32\slmgr.vbs” /ato

Rank #4
Logitech M510 Full Size Ambidextrous 2.4 GHz Wireless Mouse
  • Your hand can relax in comfort hour after hour with this ergonomically designed mouse. Its contoured shape with soft rubber grips, gently curved sides and broad palm area give you the support you need for effortless control all day long.
  • You’ve got the control to do more, faster. Flipping through photo albums and Web pages is a breeze, especially for right-handers—with three standard buttons plus Back/Forward buttons that you can also program to switch applications, go full screen and more. And side-to-side scrolling plus zoom gives you the power to scroll horizontally and vertically through your music library, maps and Facebook feeds, and zoom in and out of photos and budget spreadsheets with a click.* * Requires Logitech SetPoint software (Windows) or Logitech Control Center software (Mac OS X)
  • Two years of battery life practically eliminates the need to replace batteries. ** The On/Off switch helps conserve power, smart sleep mode extends battery life and an indicator light eliminates surprises. ** Battery life may vary based on user and computing conditions.
  • The tiny Logitech Unifying receiver stays in your laptop. There’s no need to unplug it when you move around, so there’s less worry of it being lost. And you can easily add compatible wireless mice and keyboards to the same wireless receiver.

Replace kms.example.com with the host name supplied by the organization. The default KMS TCP port is 1688. The /skms command sets the host and disables KMS autodiscovery. To remove the manually configured host and restore autodiscovery, run:

cscript.exe “$env:SystemRoot\System32\slmgr.vbs” /ckms

If your organization uses another volume-activation method, contact its administrator rather than guessing a KMS server or key.

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

Commands that do not activate Windows

Some frequently shared commands are misunderstood:

  • /upk uninstalls the current product key. It does not activate Windows, and using it unnecessarily can leave the installation unlicensed after a restart.
  • /rearm resets activation timers for licensing and deployment scenarios. It is not permanent activation and does not replace a valid license.
  • /stao is obsolete. It was deprecated and later removed from current Windows versions. The documented replacement for controlling volume-activation type is /act-type.

For example, activation type 0 permits any activation type and is the default:

cscript.exe “$env:SystemRoot\System32\slmgr.vbs” /act-type 0

Values 1, 2, and 3 restrict activation to Active Directory-based activation, KMS, and token-based activation respectively. Change this setting only when it matches your organization’s licensing design.

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

When PowerShell is not the right fix

If you have no digital license and no valid product key, there is no legitimate PowerShell command that can activate Windows 11. Purchase the correct license or contact the organization that supplied the PC.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Acer Wireless Mouse for Laptop, 2.4GHz Computer Mouse 3 Adjustable 1600 DPI
  • 【Plug and Play for Home/Office/School】The wireless computer mouse features 2.4GHz connectivity, delivering a stable, interference-free connection up to 32ft. Designed for 𝐦𝐞𝐝𝐢𝐮𝐦 𝐭𝐨 𝐥𝐚𝐫𝐠𝐞 𝐬𝐢𝐳𝐞𝐝 𝐡𝐚𝐧𝐝𝐬, it ensures comfortable use all day. Simply plug in the USB-A receiver for instant pairing—no drivers needed. 📌📌 If the mouse isn’t suitable, place the USB receiver in the battery compartment and return both.
  • 【3 Levels Adjustable DPI】This travel USB mouse offers 3 adjustable DPI settings (800, 1200, 1600), allowing you to customize sensitivity for precise design work. Effortlessly switch to match your task and elevate your productivity. 📌 Please remove the film at the bottom of the mouse before use.
  • 【Effortless Browsing】Equipped with forward and backward buttons, this computer mice streamlines your workflow, making it easy to navigate through web pages and files with a simple click. 📌Side button does not work on Mac.
  • 【Visible Indicator Light】 The pc mouse features a visual indicator for DPI levels and low battery alerts. The red light flashes once for 800 DPI, twice for 1200 DPI, and three times for 1600 DPI. When the battery level is below 10%, the light flashes red until the mouse is completely out of power.
  • 【Click to Wake】With smart sleep mode, it saves power by standby after 10 inactive minutes, just 2-3 clicks to wake. This efficient design delivers 3x longer battery life than motion-wake mice. Engineered for durability, its buttons and scroll wheel are tested for 10 million clicks, ensuring long-term reliability and consistent performance.

You can enter a valid key through the interface instead at Start > Settings > System > Activation > Change product key. For Windows 11 Pro EDU and Windows 11 Pro for Workstations, Microsoft requires activation over the internet; phone activation through SLUI 04 is not available for those editions.

FAQ

Can PowerShell activate Windows 11 for free?

No. PowerShell can install a valid product key and request activation, but it cannot generate a license or bypass activation. Windows 11 requires a valid 25-character key or a digital license.

What is the PowerShell command to activate Windows 11?

In an elevated PowerShell window, run cscript.exe “$env:SystemRoot\System32\slmgr.vbs” /ato. This requests online activation, but it succeeds only when the installation already has an applicable license or product key.

Why does Windows say my product key is invalid?

The key may be mistyped, blocked, used on too many devices, intended for another Windows version or edition, or incompatible with the device’s licensing model. Confirm the installed edition before replacing the key.

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

Does reinstalling Windows 11 require a product key?

Not always. Reinstalling the same edition on hardware with an existing digital license normally activates automatically after the device goes online. A first activation or a different edition requires the appropriate license.

Should I run slmgr /upk before entering a new key?

Usually no. The /ipk command can replace an existing key when the new key is valid and applicable. /upk removes the current key and does not activate Windows.

The Bottom Line

For a licensed Windows 11 installation, open PowerShell as administrator and run:

cscript.exe “$env:SystemRoot\System32\slmgr.vbs” /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

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

cscript.exe “$env:SystemRoot\System32\slmgr.vbs” /ato

Use your own key, make sure it matches the installed edition, and verify the result with /dli, /dlv, /xpr, or Settings > System > Activation. If the PC has a digital license, troubleshoot that license instead of trying to force activation with an unrelated key.

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.