Like it or not, licensing Windows Server has become more important to Windows Server 2008 than ever. It is very important to know how to license your Windows 2008 Servers from the command line, see how much time is left until the license expires, and how to uninstall the license. In this article, we will look at how to use a command line tool from Microsoft to do all the above steps – the tool is slmgr.vbs.

What is slmgr.vbs?

Microsoft's command line tool is slmgr.vbs. The name of the instrument is an abbreviation for Windows Software Licensing Management Tool.

This is a visual base script used to set up licensing for any Windows 2008 Server ‘whether full version or core version. To see what slmgr.vbs can do, simply run the Windows command interpreter ( cmd in the Run line) and enter:

Slmgr.vbs/?

Figure 1: Help window for slmgr.vbs

As a result, a help window will open containing all the options available in slmgr.vbs. Here are the different tasks you can perform using slmgr.vbs:

  • Licensing management not only on the local server, but also on remote Windows 2008 Servers over the network. This requires a username and password. The default managed machine, unless otherwise specified, is localhost.
  • Installing product keys using the ‘ipk.
  • Activating Windows 2008 using the ‘ato.
  • Displaying licensing information using the 'dli' option.
  • Displaying detailed licensing information using the 'dlv.' option.
  • View the Windows license expiration date using the 'xpr.' option.
  • Clearing current Windows product keys from system registry for security reasons using the 'cpky.
  • Installing a license using the 'ilc.
  • Reinstallation system files licenses using the 'rilc.
  • Reactivating your Windows evaluation license using the ‘rearm.
  • Removing a specific product key using the 'upk.
  • Display the installation ID used by Microsoft for telephone activation using the ‘dit.
  • Finally, activating the product with a confirmation ID using the ‘ato.

Let's look at examples of how Windows 2008 slmgr.vbs can help us.

How can slmgr.vbs help with an evaluation license?

If you are evaluating Windows Server 2008, you should know that license activation is not required. The evaluation version of Windows Server 2008 will run for 60 days. Although many administrators are unaware, it is possible to renew the evaluation period for an additional 60 days, this can be done three times. So you can evaluate Windows 2008 Server for 240 days, or about 8 months – wow!

Resume assessment Windows version 2008 can be done using slmgr.vbs. To do this you just need to enter:

Slmgr.vbs -rearm

Figure 2: Results after renewing the evaluation copy of Win 2008 for another 60 days

To see how much time you have left before your current evaluation copy expires, simply enter:

Slmgr.vbs -xpr

Figure 3: xpr command results showing the day and time the Win 2008 evaluation version expired

How can I get detailed information about my Windows Server 2008 license?

To get more detailed information than just the license expiration date (which the xpr command provides), you can use dli or dlv options. Here's what the results of using them look like:

Figure 4: Results of using the slmgr.vbs ‘dli command

As you can see from the results of the 'dli command, there is information about the version of the Win 2008 server being used, the license status, the remaining time, everything about the key management server.

Figure 5: Results of the slmgr.vbs ‘dlv command

The 'dlv' command provides even more detailed information about the current state of the license.

How do I activate my license on Windows 2008 Server Core?

As I said while listing the options, slmgr.vbs is used to activate Windows 2008 Server from the command line. And on Windows Server Core, which only has a command interpreter, you are forced to use slmgr.vbs to activate the Core server from the command line. Therefore, it is very important to know how to use slmgr.vbs if you have Windows Server Core. But in my opinion, still, every administrator should know the basics of using this script.

So let's say you just installed new server Windows Server 2008 Core and want to activate it. Let's say you entered your product key during installation. To activate your OS, simply enter:

Slmgr.vbs -ato

If your network is not yet configured, or there is another error, you should see a window like:

Figure 6: Error in slmgr license activation

In my case, I received the error because I had not yet configured the IP address on the Win 2008 Core Server. And then I again received an error notification because I did not configure the DNS and default gateway settings. Please note that all these things are necessary to successfully activate Windows 2008!

If you did not enter your product key during installation, you can enter it into slmgr.vbs from the command shell:

Slmgr.vbs -ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

(assuming you have a MAK key and not a KMS)

Here you can try to perform automatic activation again.

Figure 7: Successful activation of Windows 2008 using slmgr.vbs

If everything went well (as it finally did for me), you should see a window indicating successful product activation (Figure 7). Hooray!

How to handle licensing of remote Windows 2008 Server servers using slmgr.vbs?

As I said earlier, you can work not only with licenses local servers, but also remote Win servers 2008 Servers from the command line using slmgr.vbs. You just need the server hostname (hostname/IP address), as well as the administrator username and password.

To do this, simply place the machine name (machinename), then the username (username), and then the password between the slmgr command and the options like this:

slmgr.vbs server2 administrator MyPassWord1 -xpr

Note: You don't need to use .vbs slmgr command extension. It will work great even if you just type slmgr and command options.

Conclusion

Windows Server licensing is critical to whether Windows 2008 Server functions or not. In this article, we looked at how to use Microsoft's Software Licensing Management Tool ' slmgr.vbs ' to work with the licenses of your Windows servers Server from the command line. Although there are several ways to use slmgr.vbs, after reading this article you will know what to do when working with licenses and the command line in Win 2008 Core Server.


Sometimes slmgr.vbs and other VBS system errors can be related to problems in the Windows registry. Several programs can use the slmgr.vbs file, but when those programs are uninstalled or modified, sometimes "orphaned" (incorrect) VBS registry entries are left behind.

Basically, this means that while the actual path of the file may have changed, its incorrect former location is still recorded in the Windows registry. When Windows tries to look up these incorrect file references (file locations on your PC), slmgr.vbs errors can occur. Additionally, a malware infection may have corrupted Windows-related registry entries. So, these corrupted VBS registry entries need to be fixed to fix the problem at the root.

Manually editing the Windows registry to remove invalid slmgr.vbs keys is not recommended unless you are PC service professional. Mistakes made when editing the registry can render your PC inoperable and cause irreparable damage to your operating system. In fact, even one comma placed in the wrong place can prevent your computer from booting!

Because of this risk, we highly recommend using a trusted registry cleaner such as WinThruster (Developed by Microsoft Gold Certified Partner) to scan and repair any slmgr.vbs-related registry problems. Using a registry cleaner, you can automate the process of finding corrupt registry entries, missing file references (like the one causing your slmgr.vbs error), and broken links within the registry. Before each scan, a backup, which allows you to undo any changes with one click and protects you from possible damage to your computer. The best part is that eliminating registry errors can dramatically improve system speed and performance.


Warning: Unless you are an experienced PC user, we DO NOT recommend manually editing the Windows Registry. Using Registry Editor incorrectly can cause serious problems and require Windows reinstallation. We do not guarantee that problems resulting from incorrect use of Registry Editor can be corrected. You use Registry Editor at your own risk.

Before manually restoring Windows registry, you need to create a backup by exporting a portion of the registry related to slmgr.vbs (eg. Windows):

  1. Click on the button Begin.
  2. Enter " command" V search bar... DON'T CLICK YET ENTER!
  3. While holding down the keys CTRL-Shift on your keyboard, press ENTER.
  4. A dialog box for access will be displayed.
  5. Click Yes.
  6. The black box opens with a blinking cursor.
  7. Enter " regedit" and press ENTER.
  8. In the Registry Editor, select the slmgr.vbs-related key (eg. Windows) you want to back up.
  9. On the menu File select Export.
  10. On the list Save to select the folder where you want to save the backup Windows key.
  11. In the field File name enter the name of the backup file, for example " Windows backup copy".
  12. Make sure the field Export range value selected Selected branch.
  13. Click Save.
  14. The file will be saved with extension .reg.
  15. You now have a backup of your slmgr.vbs-related registry entry.

The following steps for manually editing the registry will not be described in this article, as they are likely to damage your system. If you would like more information about editing the registry manually, please check out the links below.

KMS. How to manually activate Windows

Microsoft offers two types of activation for its products - MAK (Multiple Activation Key) and KMS (Key Management Service).

Sometimes according to different Windows reasons does not want to activate on a network that has a running KMS server.

To activate manually, you need to execute 3 commands in sequence: Command line. Command line launch on behalf of administrator



Enable activation under normal access

Source:
https://technet.microsoft.com/ru-ru/library/bb490214.aspx

By default, activation requires administrator rights. However, in cases where users do not have local administrator access rights and automatic activation cannot be performed during the first 30 days of the grace period, customers can grant the right to perform these operations to users with regular access rights.

To allow users having normal access rights, install product keys, perform activation and re-equipment of computers, registry entry value

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\W indows NT\CurrentVersion\SL\UserOperations (REG_DWORD)

Need to install equal to 1.

After you enable this registry setting, all product key installation, activation, and upgrade requests must be done using a script Slmgr.vbs.

Additionally

There is also a lot of information on this topic on the Microsoft.com sites, for example.

Without activation 120 days.

After the activation period has expired, launch the shell \Windows\explorer.exe will be prohibited.

A window will appear "Windows Activation" with a message “Activate Windows now. The activation period has expired and Windows no longer works. To use Windows, you must activate this copy of Windows.".

The following options are available:

Activate Windows over the network;

Limited access (but you will be able to purchase a product key online);

Reenter your product key.

***

How to reset the activation counter

Select an option Disabled access;

– a web browser will open;

- in the window "The web page is not available in offline mode» click Offline;

– in the address bar of the browser, enter C:\Windows\System32\cmd.exe(if the operating system is not installed on the C:\ drive, enter the appropriate drive letter), click Enter;


– a window will appear "File upload - security warning" with a message “Should I run or save this file? (Name: cmd.exe. Type: Application, 294 KB. From: C:\Windows\System32)", press Launch;


– a window will appear « Internet Explorer– Security warning with a message “This publisher could not be verified. Are you sure you want to run this program? Name: cmd.exe. Publisher: Unknown publisher. This file does not have a valid digital signature to verify its publisher. You should only run programs obtained from a trusted publisher.", press Launch;

- in the window after the system prompt C:\Users\username\Desktop> enter slmgr.vbs /rearm(or just slmgr /rearm), click Enter;

- in the window that appears "Windows Script Host" with a message “The command completed successfully. Restart your computer for the changes to take effect." click OK;

– close the windows , web browser, activation window Windows;

– reboot (if after reboot the activation window appears again, turn off and turn it on again).

***

Activation mechanism settings stored in REG_DWORD-partition parameters :

:

VLActivationInterval– determines the total period of operation without activation (default value – dword:00000078, that is, 120 days);

SkipRearm– determines whether the activation counter will be allowed to be reset using the command slmgr.vbs /rearm after 4 resets (default value – dword:00000000);

:

ActivationInterval– defines the interval for displaying the activation notification operating system(default value is dword:000dbba0);

NotificationDisabled– displaying a notification about the need to activate the operating system in the notification area Taskbars(default value is dword:00000000. If you set the value 1 , then notifications will not be displayed).

Notes

1. You can run any program using a web browser Windows.

2. slmgr.vbs(script file VBScript; disk address of the file – \Windows\System32\) is Software Licensing Management Tool .

Usage: slmgr.vbs [ComputerName [UserPassword]] [

ComputerName– Name of remote ( – local);

– record with the required privileges on the remote;

Password– password of the mentioned entry.

Main file keys:

/ipk<Ключ продукта> – installing a product key (replacing an existing key);

/ato [Activation ID] – activation Windows;

/dli [Activation ID | All] – display license information ( – current license);

/dlv [Activation ID | All] – display detailed information about the license ( – current license);

/xpr [activation ID] – expiration date for the current state of the license;


Close