Monday, June 14, 2010

Quick Reference: Useful KMS Commands

Quick Reference: Useful KMS Commands

Date: June 14th 2010

What is a KMS server

KMS activates operating systems on your local network, eliminating the need for individual computers to connect to Microsoft. To do this, KMS uses a client/server method of implementation. KMS clients connect to a KMS server, called the KMS host, for activation. The KMS host resides on your local network.

KMS Setup


Note: Do all the commands below via a command prompt which has been opened with Administrative privileges.

Installing KMS Server:

Open C:\Windows\system32 and execute the following command

cscript c:\Windows\System32\slmgr.vbs /ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx


Test the KMS server configuration

The KMS server should publish its SRV records in your domain DNS, you should verify that these records exist.

Open C:\Windows\system32 and execute the following command

nslookup -type=srv _vlmcs._tcp


You should see output similar to the following:

DNS request timed out.
timeout was 2 seconds.
Server: UnKnown
Address: 192.168.3.1

_vlmcs._tcp.windows-noob.local SRV service location:
priority = 0
weight = 0
port = 1688
svr hostname = sccm2007.windows-noob.local
sccm2007.windows-noob.local internet address = 192.168.3.1

To manually activate a client over the Internet

Any client will automatically try to activate itself every 120 minutes by default, so there is no need to run the acivation command manually. However if you want to test or speed up the process then do as follows.

Open C:\Windows\system32 and execute the following command

cscript C:\windows\system32\slmgr.vbs /ato

Other useful Client Commands:

Manually configure KMS IP Address:

cscript C:\windows\system32\slmgr.vbs –skms XXX.XXX.XXX.XXX (IP Address of KMS Server)

Activate Windows Client:

cscript C:\windows\system32\slmgr.vbs -ato


Check Status of activation:

cscript C:\windows\system32\slmgr.vbs -dlv

Query KMS server

To query the KMS server and see its status open a command prompt and execute the following command.

cscript slmgr.vbs /dli


You should see output similar to below:

Microsoft ® Windows Script Host Version 5.7
Copyright © Microsoft Corporation. All rights reserved.

Name: Windows Server®, ServerStandard edition
Description: Windows Operating System - Windows Server®, VOLUME_KMS_B channel
Partial Product Key: xxxxx
License Status: Licensed

Key Management Service is enabled on this machine
Current count: 2
Listening on Port: 1688
DNS publishing enabled
KMS priority: Normal

Key Management Service cumulative requests received from clients
Total requests received: 5
Failed requests received: 0
Requests with License Status Unlicensed: 0
Requests with License Status Licensed: 0
Requests with License Status Initial grace period: 5
Requests with License Status License expired or Hardware out of tolerance: 0

Requests with License Status Non-genuine grace period: 0
Requests with License Status Notification: 0

License States

A computer can be in one of 5 license states

Initial grace Period
This occurs after the computer is installed and can only last for up to 30 days, this can be reset twice.

Non-Genuine grace Period
This occurs after a computer is found to have a non-genuine or counterfeit Windows operating system installed. This state can last up to 30 days to give you time to reactivate using a genuine copy and License key.

Out-of-tolerance grace period
This can occur when either several hardware changes are made to the computer or when the KMS key has not contacted Microsoft for updates in 180 days. This state can last up to 30 days.

Licensed
This state occurs when everything is ok and the system is activated.

Unlicensed
This state occurs when the activation period has expired and nothing was done about it. The computer will stay in a limited access state until it has been activated.

Thursday, June 10, 2010

Change Windows 7/XP/Vista/Server Product Key License Serial

1. Click Start, and then click Run.
2. In the Open box, type regedit, and then click OK.
3. In the left pane, locate and then click the following registry key: HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\Current Version\WPAEvents.
4. In the right pane, right-click OOBETimer, and then click Modify.
5. Change at least one digit of this value to deactivate Windows. This is key, modify the first one to AA, make sure you know what it was originally – you will need it in for step 12. Leave regedit open.
6. Click Start, and then click Run.
7. In the Open box, type the following command, and then click OK. %systemroot%\system32\oobe\msoobe.exe /a
8. Click Yes, I want to telephone a customer service representative to activate Windows, and then click Next.
9. Click Change Product key.
10. Type the new product key (I would use the new R2 key) in the New key boxes, and then click Update. When you get to the previous window, close product activation.
11. Return to regedit. In the left pane, locate and then click the following registry key: HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\Current Version\WPAEvents. If not currently open.
12. Change the first digits back to what you noted in step 5.
13. Close regedit.
14. Click Start, and then click Run.
15. In the Open box, type the following command, and then click OK. %systemroot%\system32\oobe\msoobe.exe /a
16. This time it should say you are already activated, click OK.