Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


December 2008

Control Your Licensing with Slmgr

Tame the necessary evil that is Windows Product Activation
RSS
Subscribe to Windows IT Pro | See More Tips Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Executive Summary: Use Slmgr to change a Windows Vista or Windows Server 2008 product key or activate a system, extend your product-activation grace period, and determine whether your computer's license is a volume, retail, or OEM license.

The annoyance that is Windows Product Activation used to plague only small businesses and home PC users, but now that Windows Vista and Windows Server 2008 use it, we all have to grapple with it. Your primary client-side tool for managing a system’s software licensing is called Slmgr (slmgr.vbs). Need to change a product key or activate a system from the command line? Want to extend Server 2008’s 60-day grace period to 240 days? Not sure whether your computer’s license is a volume, retail, or OEM license? If so, you need Slmgr.

Putting It to Work
If you have systems without a GUI or systems that need to activate via a batch file, Slmgr’s -ato option is useful. To activate a system, simply open an elevated command prompt and type

slmgr -ato
If you’re working on a system that’s using either a retail copy or a volume license copy of Windows that’s been activated with the Multiple Activation Key (MAK), Slmgr attempts to contact Microsoft’s activation web servers. However, if the system is running a copy of Windows built from the volume license media and has been activated with the Volume License Key (VLK), Slmgr knows that it should instead try to contact your organization’s Key Management Server (KMS). When Slmgr requires Microsoft’s servers, it already knows those Internet addresses. But if Slmgr needs to find your KMS server, it needs to ask its local DNS server to resolve an SRV record that reveals your local KMS server’s host name:
_vlmcs._tcp.<your organization’s DNS zone name>
For example, bigfirm.com’s SRV records identifying its KMS server would be _vlmcs._tcp.bigfirm.com. Sometimes, though, technical configuration problems or institutional constraints keep that SRV record out of your organization’s DNS zone, and Slmgr can’t activate your copy of Windows. But if you know your local KMS server’s host name or IP address, you can tell your Vista or Server 2008 system to activate via that KMS server by using the command
slmgr -skms <server name or IP address>[:<port>]
So, if your KMS server is named kms1.bigfirm.com, you’d type
slmgr -skms kms1.bigfirm.com
The optional colon and port number point to the fact that activation traffic runs over port 1688, by default; if you’ve reconfigured your KMS server to use another port (e.g., port 2010), you’d extend the Slmgr -skms command by suffixing a colon and that port number to the KMS server’s name. For example,
slmgr -skms kms1.bigfirm.com:2010
Before you can activate a copy of Windows, you need to give it a product key. The easiest method is to make liberal use of the greatly improved setup scripts in Vista and Server 2008. But if you need to install or change a product key from the command line, the -ipk (“install product key”) option can help. For example,
slmgr -ipk YGR45-THIS9-WONT5-0WORK-D7667
would enter the YGR45-THIS9-WONT5-0WORK-D7667 product key.

Have you ever needed to know whether a system license is an OEM, retail, or volume license? The Slmgr -dli command shows your Windows version (e.g., Vista Ultimate, Server Enterprise), the final five characters in your product key, the licensing state, whether you’ve activated, and—if not yet activated—how many minutes you have left. The Slmgr -dlv command also reveals that information, along with a few more activation details and several URLs to places on Microsoft’s site that appear not to work anymore.

Finally, suppose you don’t yet want to activate your copy of Windows for some reason. Vista gives you a 30-day grace period, and Server 2008 gives you 60 days, but both OSs also let you reset those grace periods four times, making Vista’s actual grace period about 120 days and Server 2008’s about 240 days. To reset it, just open an elevated command prompt and type

slmgr -rearm

Take Control
If you’re running Slmgr for the first time to do anything but activate a system, you might notice that it’s slow. I suspect that the extremely complex mathematics underlying product-key and license verification add up to one of the most important weapons in Microsoft’s arsenal in its war on piracy—although no one at Microsoft has ever confirmed this suspicion. Regardless, dealing with activation is no fun, but at least Slmgr lets you take greater control of it.

End of Article



Reader Comments
I heard that if you purchase computers from Dell, HP or other brand name without Windows Vista installed the manufactures alter the BIOS so the computers will not be able to use KMS server for activation. Do you have any information on this?

marcelon December 08, 2008 (Article Rating: )


SLMGR -DLV returns verbose output on the currently installed licenses but the "several URLs to places Microsoft's site that appear not to work anymore" is incorrect. The URLs listed are web service (SOAP) interfaces which SLMGR uses to post the necessary product, nstall & machine details needed to procure a license. If you inspect the URLs using a browser you can follow a link to the complete WSDL description of the SOAP interfaces for each.

ratfink February 08, 2009 (Article Rating: )


You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

WinInfo Short Takes: Week of November 23, 2009

An often irreverent look at some of the week's other news, including some post-PDC some soul searching, a Google Chrome OS announcement and a Microsoft response, Windows 7 off to a supposedly strong start, the Jonas Brothers and Xbox 360, and so much more ...

2009 Windows IT Pro Editors' Best and Community Choice Awards

Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...


Related Events Deep Dive into Windows Server 2008 R2 presented by John Savill

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement