December 12, 2017
Here are a list of operations I find useful for dealing with windows activation from the console.
CSCRIPT instead of WSCRIPT
One thing that might start to get annoying is slmgr.vbs is a VBScript. What this means is when you run it, it is going to put up a heap of message boxes.
To avoid this you can change the default WHS runner to cscript instead of wscript. To do that run the following command from an elevated command prompt:
If you want to change this back to WScript later simply run the following instead:
Check activation status
To check the activation status of Windows you can run the following from an elevated console.
This will then show you details of the license and if the system is activated or not. Pay attention to the License Status property to see if windows is activated or not.
How to enter a product key.
slmgr.vbs -ipk <product key here>
Wait a few moments after you enter this command. Then enter the following which will instruct windows to go online to complete the activation:
If it fails you will be given a command to type in to get the error message. A lot of the time this can fail because you tried it too soon or if the key was bad.
Check current expiry date
This will list when the license will expire. In a lot of cases it will auto renew before that date.
Set KMS server
slmgr.vbs -skms <hostname>:[port]
Port is only required if non standard port is used.
Clear KMS server
Extend Trial Period
You can see how many rearms you have by using