Software Licensing Management Tool (slmgr) is a CLI in Windows which is used to perform advanced Windows activation tasks.
Slmgr is used to activate Windows or change the product key if the normal activation process fails or if the normal activation process throws “Windows is not genuine” errors.
How to user Slmgr Commands
The Slmgr commands are used in a Windows command prompt. Please open the command prompt as an administrator using below process.
Click on Search > type ‘cmd’ > Right Click on ‘Command Prompt’
Common Slmgr Commands and its uses
CHECK ACTIVATION STATUS
Use this slmgr command to see if Windows is activated. You’ll see a message that says Windows is activated if it is, or be given a date if it’s not permanently activated, or see an error if no product key has been provided.
Note: A regular Command Prompt can work for some of these tasks but others—ones that involve changing data and not just displaying it—require an elevated Command Prompt.
VIEW CURRENT LICENSE INFO
With this slmgr command, you’ll see part of the product key being used on your computer and an indication of whether the license is active. Other details are included here, too, like the KMS machine IP address, activation renewal interval, and other Key Management Services (KMS) information.
DETAILED LICENSE INFO
This command for slmgr.vbs reveals a lot more information about your computer. It starts off with the Windows version number and follows with the activation ID, extended PID, installation ID, remaining Windows rearm and SKU count, and a few other details on top of what the /dli option shows.
RESET ACTIVATION TIMERS
The rearm command resets activation timers, which essentially lets you use Windows without activating it by extending the trial. For example, if you’re using Windows on a 30-day trial, this one-month limitation can be reset back to the beginning after entering this slmgr command.
A restart of your computer is required to complete this command.
Note: There’s a limit to how many times you can rearm the Windows activation files. Check the rearm count with the /dlv command above to see how many cycles are left.
DELETE WINDOWS PRODUCT KEY
Use this slmgr command to remove the product key from Windows Registry. Doing this will not delete the key from your computer or un-activate Windows, but it will prevent key finder programs and malicious tools from being able to retrieve the key.
ACTIVATE WINDOWS ONLINE
This slmgr command forces Windows to try online activation, which is useful if you attempted normal activation steps (not using Slmgr.vbs) but received a connection problem or similar error.
CHANGE WINDOWS PRODUCT KEY
slmgr /ipk 12345-12345-12345-12345-12345
Change the Windows product key with this slmgr command. Replace those numbers with the real product key, but be sure to include the dashes. Restart the computer to fully apply the new key.
If the key isn’t correct, you’ll see a message that The Software Licensing Service reported that the product key is invalid.
CHANGE REMOTE PRODUCT KEY
slmgr /ipk mattpc Safi P@ssw0rd 12345-12345-12345-12345-12345
This command is the exact same as the slmgr /ipk command shown above but instead of executing the change product key request on the local computer, it’s performed on the machine named mattpc with the Matt admin users’ login credentials.
A fitting last example for the slmgr command in Windows is this one, which will uninstall the product key from the local computer. Just reboot your computer after you see the Uninstalled product key successfully message.
Apart from the above, there are other Slmgr CLI which can be used to perform advanced functions. Below is a compilation of all the useful CLI commands for Slmgr. Please have a look at the slmgr command syntax and the other supported options:
slmgr [MachineName [username [password]]] [option]
Slmgr Command Options
|MachineName||The machine to administer. Defaults to the local machine if omitted.|
|username||The username of an administrator account on the remote machine.|
|password||The password for username.|
|/ato||Activate Windows license and product key against Microsoft’s server.|
|/atp Confirmation_ID||Activate the product with a user-provided Confirmation_ID.|
|/cdns||Disable DNS publishing by the KMS host.|
|/ckhc||Disable KMS host caching.|
|/ckms||Clear the name of KMS server used to default and port to default.|
|/cpky||Delete the Windows product key from Windows Registry.|
|/cpri||Set the KMS priority to low.|
|/dli||Display the current license information with activation status and partial product key.|
|/dlv||Display additional license information. Similar to /dli but more detailed.|
|/dti||Display Installation ID for offline activation.|
|/ipk key||Change the Windows product key. Replaces the current product key if present.|
|/ilc file||Install a license file.|
|/rilc||Reinstall system license files.|
|/rearm||Reset the evaluation period/licensing status and activation state of the computer. Use /rearm-app to specify an app, or /rearm-sku for a specific sku.|
|/skms||Set the Volume Licensing KMS server and/or the port used for KMS activation.|
|/skhc||Enable KMS host caching (enabled by default). This blocks the use of DNS priority and weight after the initial discovery of a working KMS host.|
|/sai interval||Sets the interval in minutes for unactivated clients to attempt KMS connection.|
|/spri||Set the KMS priority to normal (default).|
|/sprt port||Set the port on which the KMS host listens for client activation requests (default TCP port is 1688).|
|/sdns||Enable DNS publishing by the KMS host (default).|
|/upk||Uninstall the currently installed Windows product key and return the license status back to a trial state.|
|/xpr||Show the expiry date of the current license or indicate whether activation is permanent.|
That’s all folks. Thanks for reading. Have a great day…!