Key Management Service (KMS) Commands Everyone Must Know

There are several commands I use often with Microsoft’s Key Management Service.  Normally, when a server is joined to the domain, there is almost never an issue with KMS.  That’s because KMS advertises through DNS, and if a server is joined to the domain, it’s likely pointed at the right DNS servers to pick up the KMS advertisement.

However, sometimes I have a server in the DMZ that is not domain joined, and is also not using AD-based DNS servers.  Alternatively, I might have a server on the local IT network, and even be using the AD-based DNS servers, but through a combination of sysprep, not being domain-joined, being off for a while or a whole host of other related circumstances it’s just not picking up the KMS advertisement.

The first command specifies a specific KMS server and port, which works great in the first circumstance:

slmgr.vbs /skms <value>:<port>

Note that the default port of KMS is TCP 1688

…for the second situation, oftimes you just need to clear KMS so that it gets set back to automatic:

slmgr.vbs /ckms

…and other times, you may have used a retail key during installation, and need to get it set back to a specific volume license key, in that situation, use:

slmgr.vbs /ipk [Volume License Key]

Finally, the following command will show you a nice screen shot of what is actually happening with activation and if there are any problems with activation:

Slmgr.vbs /ato

That’s it!  Between those three commands you can likely get any modern windows client/server to pick up the KMS instance on your domain and know exactly what’s going on with it.

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s