Windows 2008 Servers supports license management from the command line, using slmgr.vbs. With it you can see how much time you have left on an eval, add or uninstall licenses and much more. The name of the tool is actually Windows Software Licensing Management Tool. It is a visual basic script used to configure licensing on any Windows 2008 Server – either the full version or the core version. To see what slmgr.vbs can do, you can simply open a Windows command prompt (with cmd.exe) and type:
slmgr.vbs /?
Figure 1: Help window for slmgr.vbs
This displays a help window that will show you all the slmgr.vbs options. Here are the various tasks you can perform with slmgr.vbs:
- Manage licensing not only on the local server but also on remote Windows 2008 Servers, over the network. A username and password is required for this. If a server is not specified it will default to the localhost.
- –ipk: Install product keys
- –ato: Activate Windows 2008
- –dli: Display license information
- –dlv: Display detailed license information
- –xpr: Show when the current Windows license will expire
- –cpky: Clear the current Windows product key from the registry (for security reasons)
- –ilc: Install a license
- –rilc: Reinstall system license files
- –rearm: Reactive a Windows evaluation license
- –upk: Uninstall a certain product key
- –dit: Display your installation ID, used by Microsoft for offline (telephone) activation
- –ato: Active a product with the confirmation ID
Here are some examples of how Windows 2008 slmgr.vbs can be used.
How can slmgr.vbs help with Evaluation licensing?
If you are evaluating Windows Server 2008, you should know that license activation is not required. An evaluation version of Windows Server 2008 will work for 60 days. While many admins do not know it, you can “re-arm” that evaluation period for another 60 days, three times over. Thus, you could evaluate Windows 2008 Server for a total of 240 days, or about 8 months.
You can re-arm this evaluation of Windows 2008 using slmgr.vbs. To do this, just type:
slmgr.vbs –rearm

Figure 2: Results after rearming your Win 2008 evaluation copy for another 60 days.
To see how much time you have left in your current evaluation period, just type:
slmgr.vbs –xpr

Figure 3: Results of xpr command, showing the date and time that the license grace period for Win 2008 expires.
Microsoft has a knowledgebase document on how to automatically extend the evaluation of licensing with a script. By implementing this script, you could use Windows Server 2008 for the full 240 days without having to do anything. For more information on that, please see Microsoft KB 948472.
How do I get detailed information on my Windows Server 2008 license?
To get more detailed information than just the expiration date (given by the xpr command), you can use the dli or dlv options. Here is what their output looks like:

Figure 4: slmgr.vbs –dli output showing license information.
As you can see in the –dli option output, there is more information on the version of Win 2008 you are running, the license status, time renaming (down to the second), and all about the key management server.

Figure 5: slmgr.vbs –dlv output showing detailed license information
With the –dlv option, there is even more detailed information about the current state of your licenses.
How can I activate my license in Windows 2008 Server Core?
In Windows Server Core, with only a command prompt, you are forced to use slmgr.vbs to activate your Core server from the command line. Thus, it is much more critical to know how to use slmgr.vbs if you are using Windows Server Core. Still, every Admin, in my opinion, should know the basics of using it.
Let’s assume that you entered a product key during the installation of Windows 2008 Server Core. To activate your OS, just type:
slmgr.vbs –ato
If you do not have networking configured, or you get another error, you will get a window that says something like this:

Figure 6: Error from slmgr license activation
If you did not enter a product key during the install process, you can enter one with slmgr.vbs at the command line with:
slmgr.vbs –ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
From there, you can attempt the auto activation again.

Figure 7: Successful activation of Windows 2008 with slmgr.vbs
If you are successful you should see the “product activated successfully” window, as displayed in Figure 7.
How do I administer licensing of a remote Windows 2008 Server using slmgr.vbs?
Just enter the machinename, username, and password between the slmgr command and the options, like this:
slmgr.vbs <ServerName> administrator <Password> -xpr
Summary
slmgr.vbs is a useful, and often, essential all admins should know.