How to Activate Windows Via PowerShell

By Aayush

In the world of Windows operating systems, activation is a vital process that ensures the legitimacy and functionality of your software. Whether setting up a new system or upgrading an existing one, activating Windows is crucial to unlock its full potential. While various methods are available for activation, using PowerShell presents a convenient and efficient approach.

In this blog post, we will delve into the realm of PowerShell and explore how it can be leveraged to activate Windows seamlessly. Whether you’re a tech enthusiast, an IT professional, or someone looking to activate your Windows system, this guide will provide valuable insights and step-by-step instructions to simplify the activation process.

Advertisements

What is PowerShell?

PowerShell, developed by Microsoft, is a command-line shell and scripting language that provides a robust platform for automating administrative tasks and managing system configurations in Windows. With PowerShell, users can interact with the operating system and execute various operations using commands and scripts.

The capabilities of PowerShell are extensive, ranging from file and folder management, registry manipulation, network configuration, software installation, uninstallation, and much more. It offers a wide array of commands known as cmdlets, which are designed to perform specific actions and can be combined to create intricate automation workflows.

Advertisements

Activate Windows via PowerShell

In this article, I will describe how quickly Activate Windows via PowerShell allows and what options are given to you. I, therefore, go through the following three steps:

  1. Remove product key
  2. Install a valid Windows product key
  3. Activate Windows manually

Remove the Windows product key

I usually can enter the product key during the installation of Windows Server, and thanks to automatic activation, I don’t have to worry about it later. However, if the activation code is not specified during installation or is already included in the image, it will then be missing or could be considered invalid. Windows then refuses the activation and asks you to enter a new product key.

Advertisements

In the above example, however, I had a strange case where Windows told me that my license key could not be checked despite an existing internet connection. No problem; I try to activate Windows via PowerShell.

In this case, I have made it a habit first to remove a possibly pre-installed license key. This is the case, for example, with OEM versions from the hardware manufacturers. This works: Open the Windows PowerShell as an administrator and enter the command.

Advertisements

slmgr /upk

Uninstalled Product Key slmgr/upk

That’s it – the product key will be uninstalled immediately.

Activate Windows 10 PowerShell

So, let’s start with How You Can activate Windows 10 with Powershell. To Perform Powershell Windows Activation, follow these detailed steps:

  How to Document System events with Powershell

Open PowerShell as Administrator

  1. Press the Windows key on your keyboard.
  2. Type “PowerShell” in the search bar.
  3. Right-click on “Windows PowerShell” from the search results.
  4. Select “Run as administrator” to open PowerShell with elevated privileges.

Run the Activation Command

In the elevated PowerShell window, type the following command and press Enter:

slmgr /ipk <your_product_key>

Replace `<your_product_key>` with the 25-character product key provided with your copy of Windows.

Initiate Activation

After running the previous command, type the following command and hit Enter:

slmgr /ato

This command initiates the activation process using the provided product key.

Verify Activation Status

To ensure successful activation, execute the following command in PowerShell:

slmgr /xpr

You will see a message confirming that Windows is activated if the activation was successful.

Verify Activation Status

Activating Windows 11 via PowerShell

To activate Windows 11 using PowerShell, follow the steps outlined below:

Launch PowerShell with Administrative Privileges

  1. Press the Windows key on your keyboard.
  2. Type “PowerShell” in the search bar.
  3. Right-click on “Windows PowerShell” from the search results.
  4. Select “Run as administrator” to open PowerShell with elevated privileges.

Run the Activation Command

In the elevated PowerShell window, type the following command and press Enter:

wsl -set-version Ubuntu-20.04 2

This command sets the version of Windows Subsystem for Linux (WSL) to 2, which is required for Windows 11 activation.

Initiate Activation

After setting the WSL version, enter the following command and hit Enter:

slmgr /ipk <your_product_key>

Replace `<your_product_key>` with the 25-character product key provided with your copy of Windows.

Verify Activation Status

To confirm successful activation, execute the following command in PowerShell:

slmgr /xpr

If the activation is successful, you will receive a message confirming that Windows is activated.

Activate Windows PowerShell Script

We Do not Encourage or Suggest to use of this Method. Use it at your own risk.

Multiple scripts are available on GitHub Called Windows PowerShell Script, which you can use to Activate your Windows. However, this method is not safe. It can be used for testing purposes. Among them, one is:

  • Microsoft Activation Scripts (MAS): This Windows and Office activator uses HWID / KMS38 / Online KMS activation methods, focusing on open-source code and fewer antivirus detections.

FAQ

What is PowerShell?

PowerShell is a command-line shell and scripting language developed by Microsoft. It provides a robust environment for automating administrative tasks and managing system configurations in Windows.

Why would I want to activate Windows via PowerShell?

Activating Windows via PowerShell can be helpful in scenarios where you need to automate the activation process on multiple machines, perform activation as part of a larger script or deployment process, or troubleshoot activation issues.

  How to Pause PowerShell Script

How do I open PowerShell?

To open PowerShell, press the Windows key, type “PowerShell” in the search bar, and select the “Windows PowerShell” or “Windows PowerShell (Admin)” option from the results. Alternatively, you can right-click the Start button, and choose “Windows PowerShell” or “Windows PowerShell (Admin)” from the menu.

What is the command to activate Windows via PowerShell?

The command to activate Windows via PowerShell is

 "slmgr.vbs -ato".

This command triggers the activation process and attempts to activate the installed Windows license using the appropriate product key.

Do I need administrative privileges to activate Windows via PowerShell?

Yes, administrative privileges are required to run PowerShell commands for activating Windows. Make sure to open PowerShell as an administrator to execute the activation command successfully.

How can I check the activation status of Windows via PowerShell?

You can check the activation status of Windows using the “slmgr.vbs -dli” command in PowerShell. This command displays detailed license information, including the activation status and remaining grace period.

Can I activate Windows using PowerShell on all editions of Windows?

PowerShell activation is available on most editions of Windows, including Windows 10, Windows 8.1, Windows 7, and Windows Server versions. However, the specific steps and commands may vary slightly depending on your Windows version.

Where can I find the product key to activate Windows via PowerShell?

The product key required for activating Windows can usually be found on a sticker attached to your computer or in the documentation provided with your Windows installation. The product key is associated with your Microsoft account if you have a digital license.

What should I do if I encounter issues while activating Windows via PowerShell?

If you encounter any issues during activation, ensure you have a valid product key or digital license. Double-check your internet connection, as activation may require an active internet connection. If problems persist, you may need to contact Microsoft support for further assistance.

Are there any alternative methods to activate Windows?

Yes, besides PowerShell, you can activate Windows using other methods such as the graphical user interface (GUI) activation wizard, a product key in the Settings app, or the command-line tool “slmgr.vbs” directly.

Is it legal to activate Windows via PowerShell?

Activating Windows via PowerShell is a legitimate method as long as you have a valid product key or digital license for the installed version of Windows. Using genuine permits and complying with Microsoft’s licensing terms and conditions is essential.

Follow:
Aayush is a B.Tech graduate and the talented administrator behind AllTechNerd. . A Tech Enthusiast. Who writes mostly about Technology, Blogging and Digital Marketing.Professional skilled in Search Engine Optimization (SEO), WordPress, Google Webmaster Tools, Google Analytics
Leave a Comment