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.
Command Options
/dli | Display the information on the current license with activation status. |
/dlv | Work like /dli but provide more information about the license. |
/rearm | Extends the trial period of Windows. |
/xpr | Display the expiration date of the Windows license. |
/ato | Attempts to activate the Windows using the product key that is currently installed on the system. |
/ipk <product_key> | Installs a new product key. |
/upk | Uninstall the product key. |
/cpky | Removes the product key from the Windows registry. |
/skms <ServerName> | Specifies the KMS server that your computer will contact for activation. |
/skmsport <PortNumber> | Specifies the port number that your computer will use to connect to the KMS server. The default port is 1688. |
/ckms | 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.
Examples
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:
slmgr /dli
Your Windows license information will be displayed through a dedicated window.
Enter the following command to display more detailed information about the current license:
slmgr /dlv
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:
slmgr /xpr
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:
slmgr /rearm
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:
slmgr /ato
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
Use the /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:
slmgr /upk
slmgr /cpky
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 kms.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:
slmgr /ckms
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.