Friday, February 11, 2011

Install a KMS Server

Tired of being warned that your Win7 is counterfeit? Instead of typing in product keys, use Windows Key Management Service aka KMS. Works well for any Windows 2008/7 network with more than 25 seats (or 6 servers if you're doing only Windows 2008 R2 servers). If you don't hit 25, no one can activate.

To install the KMS service:
  1. Install Windows 2008 R2. For me, I've found that using a domain controller to host the KMS avoids any DNS issues. KMS is advertised via DNS.
  2. Install the key: slmgr.vbs /ipk
  3. Activate the first KMS license: slmgr.vbs DNS name of client username password /ato
  4. Verify that your clients can see the KMS server via DNS. From a Windows installation that you want to activate, run: nslookup -type=srv _vlmcs._tcp.
    You should get the KMS server IP and DNS name back.
  5. Once that first one is up, boot up at least 24 other Windows machines. Windows clients should automatically register with the KMS server.
  6. Check how many Windows clients have registered by running: slmgr.vbs /dlv on your KMS server and Look for the Current Count
  7. Once you hit 25, after you try to activate windows, you should get an Activation Successful message. If you don't, Google the error code. Some common errors and solutions are below:
Troubleshooting:
  • 0xC004F074 "The Key Management Server (KMS) is unavailable" - you'll get this error if your client's time is more than 4 hours different than the KMS host's time. Change your client's time. Better yet, use an NTP server.  Also ensure that the time zones match (e.g. a client on 10am GMT will error when connecting to a KMS server on 10am PDT).
  • 0xc004f038 is good. It means that you can see your KMS server, but you haven't reached your threshold yet. Keep on activating more clients or convert some clients from MAK to KMS.
  • To convert existing MAK clients to KMS, run: slmgr.vbs /ipk FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4 . Don't worry, this key is Microsoft's public KMS client setup key for Windows 7 Pro. For this key and other Windows flavours, check out http://technet.microsoft.com/en-us/library/ff793406.aspx
All KMS commands use slmgr.vbs and they can be run remotely. You don't even need to log in to the client desktops! Useful commands include:
  • Activate windows:
    slmgr.vbs [DNS client name] /ato
  • Display license info:
    slmgr.vbs [DNS client name] /dli
  • Install the Win7 Pro KMS client setup key:
    slmgr.vbs [DNS client name] /ipk FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4
To run these commands locally (i.e. if you're already on the client desktop), you can omit your credientials and add only the command switch (ex. slmgr.vbs /dli ).

Note that the Windows Server 2008 R2 KMS key will activate W2K8R2 server AND Windows 7 clients. For more details on the licensing scope of KMS keys, check out http://technet.microsoft.com/en-us/library/ee939271.aspx