What is slmgr.vbs?
The tool name is an abbreviation for Windows Software Licensing Management Tool.
This is a visual baseline script used to configure the licensing of any Windows 2008 Server, whether it be the full version or the core version. To see what slmgr.vbs can do, simply run the Windows command interpreter (cmd in the Run line) and enter:
slmgr /? - Manage licensing not only on the local server, but also on remote Windows 2008 Servers servers over the network. This requires a username and password. The default managed machine, if not specified, is the local host (localhost).
- Installing product keys using the ‘optionipk .
- Activating Windows 2008 with the ‘optionato .
- Displaying licensing information using the ‘optiondli .
- Displaying detailed licensing information using the ‘optiondlv .
- View the expiration date of a Windows license using the ‘optionxpr .
- Clean up current Windows product keys from the registry for security reasons using the ‘optioncpky .
- Installing a license using the ‘optionilc .
- Reinstalling system license files using the ‘optionrilc .
- Reactivate a Windows Evaluation License with the ‘Toolrearm .
- Delete a specific product key using the опции optionupk .
- Displaying the installation ID used by Microsoft to activate by phone using the ‘optiondit .
- Finally, product activation with confirmation ID using the optionato .
If you are evaluating Windows Server 2008, you should know that license activation is not required. An evaluation version of Windows Server 2008 will run for 60 days. Although many administrators do not know, you can resume the evaluation period for another 60 days, you can do this three times. So you can evaluate Windows 2008 Server for 240 days, or about 8 months - wow!
You can resume the evaluation version of Windows 2008 using slmgr.vbs. To do this, simply enter:
slmgr -rearm 
To see how much time you have before the current evaluation copy expires, just type:
slmgr -xpr 
In fact, Microsoft even has an interesting document in the knowledge base on how to automatically increase the estimated period using the script. By applying this script, you can use Windows Server 2008 for a full 240 days without having to do anything. For more information on this, see the article.
Microsoft KB 948472.
How to get detailed information about your license Windows Server 2008?
To obtain more detailed information than just the expiration date of the license (which is provided by the xpr command), you can use
dli or
dlv options.
Team '
dlv provides more detailed information about the current license status.

How can I activate my license on a Windows 2008 Server Core server?
As I said before, in listing options, slmgr.vbs is used to activate Windows 2008 Server from the command line. And in Windows Server Core, which has only a command interpreter, you have 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, nevertheless, every administrator should know the basics of using this script.
So, let's say that you just installed a new Windows Server 2008 Core server and want to activate it. Suppose you entered a product key during installation. To activate your OS, just enter:
slmgr -ato If your network is not yet configured, or there is another error, you should see a window like this:

I received an error because I have 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 settings and the main gateway. Keep in mind that all these things are necessary for successful activation of Windows 2008!
If you did not enter the product key during installation, you can enter it into slmgr.vbs from the command interpreter:
slmgr -ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX (Suppose you have a MAK key, not KMS)
Here you can try automatic activation again.
If everything went fine (as I finally had), you should have a window saying that the product was successfully activated.

Hooray!
How to work with licensing of remote Windows 2008 Server servers using slmgr.vbs?
As I said earlier, you can work not only with licenses of local servers, but also remote Win 2008 Servers from the command line using slmgr.vbs. You only 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 as follows:
slmgr server2 administrator MyPassWord1 -xpr