Slmgr Command Examples: Master Windows Licensing with This Tool
Slmgr, which stands for Software Licensing Manager, is a Windows command-line tool used to manage Windows activation and licensing tasks. You can use the
slmgr command to check license status, activate Windows, and install or uninstall license keys.
- Command Options.
- View Your Windows License Information.
- Check Your Windows License Expiration Date.
- Extend the Evaluation Period for Windows.
- Manually Activate Windows with /ato.
- Adding and Removing Windows Keys.
- Managing KMS Activation.
|Display the information on the current license with activation status.
|Work like /dli but provide more information about the license.
|Extends the trial period of Windows.
|Display the expiration date of the Windows license.
|Attempts to activate the Windows using the product key that is currently installed on the system.
|Installs a new product key.
|Uninstall the product key.
|Removes the product key from the Windows registry.
|Specifies the KMS server that your computer will contact for activation.
|Specifies the port number that your computer will use to connect to the KMS server. The default port is 1688.
|Removes details of the previously configured KMS Server and sets the port to default.
When you run the
slmgr command without any parameters, it displays the command syntax and available options.
This section provides examples of the
slmgr commands. Open a Command Prompt or PowerShell with administrative privileges and then run the commands according to your requirements. Improper use of these commands can lead to licensing problems.
How to View Your Windows License Information
You can use the following command to display the current license information, including activation status and a partial product key:
Your Windows license information will be displayed through a dedicated window.
Enter the following command to display more detailed information about the current license:
How to Use slmgr to Check Windows License Expiration
You can find the expiration date of your current Windows license by entering the following command:
Running the command on my Windows 10 PC resulted in the following message, indicating that Windows is permanently activated.
The expiration date was displayed on a Windows Server 2022 machine using an evaluation license.
Extend the Evaluation Period for Windows
If your Windows trial period ends, you can use the
/rearm command to extend the trial:
Normally, the Windows Server trial period lasts 180 days for Standard and Datacenter editions. Rearming it for the first time adds another 180 days. Subsequent rearms add 90 days each, allowing for a total trial period of up to 540 days (this may vary depending on the Windows version).
Manually Activate Windows with /ato
If your product key is not activated, you can run the following command to activate it:
Windows usually activates automatically during installation or when a valid product key is entered. However, if activation fails for some reason, you can use the
/ato command to manually attempt activation with the current product key.
Adding and Removing Windows License Keys
/ipk option to enter a new product key or update the existing one. In the following example,
ABCDEF-12345-ABCDEF-12345-ABCDEF is the product key being entered:
slmgr /ipk ABCDEF-12345-ABCDEF-12345-ABCDEF
To remove a product key, run the following two commands:
The first command uninstalls the product key, while the second command clears the registry of any remaining key information.
Managing KMS Activation with slmgr Commands
By default, Windows clients automatically attempt to discover KMS servers on a Windows network. However, using the
/skms option overrides this behavior and forces the client to connect to a specific KMS host.
The following example sets the KMS host server to k
ms.example.local and specifies the port as
1688 (the port number is optional, with
1688 being the default port):
slmgr /skms kms.example.local:1688
To clear the configured KMS server and port settings, enter the following command:
That brings us to the end of this article on using the
slmgr command to manage Windows licensing and activation. We've covered everything from viewing license information to installing keys using various command options.