The Software License Manager (slmgr.vbs) script is used to configure and retrieve volume activation information for the Office KMS host and the Windows host. For more information, see Configuring KMS Hosts for Windows. You can run the script locally on the target computer or remotely from another computer. You have to be an administrator to use the script. If a standard user runs slmgr.vbs, some license data might be missing or incorrect, and many operations are prohibited.

The slmgr.vbs script can use the Windows-based script host, wscript.exe, or the command-based script host, cscript.exe, and administrators can specify which script engine to use. If no script engine is specified, slmgr.vbs runs by using the default script engine, wscript.exe. We recommend the cscript.exe script engine.

You must restart the Software Licensing Service for any changes to take effect. To restart the Software Licensing Service, use the Microsoft Management Console (MMC) Services snap-in or run the following command:

net stop sppsvc && net start sppsvc

The slmgr.vbs script requires at least one parameter. If you run the script without any parameters, it displays Help information. The following table lists slmgr.vbs command-line options, and a description of each. Most of the parameters in the table configure the KMS host computer. However, the parameters /sai and /sri are passed to KMS clients after the KMS clients contact the KMS host computer. The general syntax of slmgr.vbs is as follows (assuming you are using the cscript.exe as the script engine):

cscript slmgr.vbs /parameter
cscript slmgr.vbs [ComputerName] [User] [Password] [Option]

ComputerName Name of the remote computer. If you do not provide a computer name, the local computer is used.

User Account with required permission on the remote computer.

Password for the account. If you do not provide a user account and password, current credentials are used.

Options are shown in the following table.

Slmgr.vbs command options — standard

OptionDescription
ipk [ProductKey]Installs the product key for Windows (default) or other application identified by the product key.
ato [ActivationID]Activates the KMS host for Windows (default), or the application that is identified when its Activation ID is provided. The Office 2019 Activation ID is 70512334-47B4-44DB-A233-BE5EA33B914C, and the Office 2016 Activation ID is 98EBFE73-2084-4C97-932C-C0CD1643BEA7.
dti [ActivationID]Displays the Installation ID that is used for telephone activation of the KMS host computer for Windows (default) or the application that is identified when its Activation ID is provided. The Office 2019 Activation ID is 70512334-47B4-44DB-A233-BE5EA33B914C, and the Office 2016 Activation ID is 98EBFE73-2084-4C97-932C-C0CD1643BEA7. You enter the Installation ID into the telephone to receive the Confirmation ID, which is used for activating the KMS host computer by using the /atp parameter.
atp [ConfirmationID][ActivationID]After the Confirmation ID is received, activates the KMS host for Windows (default) or the application that is identified when its Activation ID is provided. The Office 2019 Activation ID is 70512334-47B4-44DB-A233-BE5EA33B914C, and the Office 2016 Activation ID is 98EBFE73-2084-4C97-932C-C0CD1643BEA7.
dlv [ActivationID]Displays detailed license information for Windows (default), or the application that is identified when its Activation ID is provided. The Office 2019 Activation ID is 70512334-47B4-44DB-A233-BE5EA33B914C, and the Office 2016 Activation ID is 98EBFE73-2084-4C97-932C-C0CD1643BEA7.

 

For example, run the following command at the elevated command prompt, in the C:\windows\system32 folder to get the status of the Office KMS host:

cscript slmgr.vbs /dlv 70512334-47B4-44DB-A233-BE5EA33B914C

dli [ActivationID]Displays license information for Windows (default), or the application that is identified when its Activation ID is provided. The Office 2019 Activation ID is 70512334-47B4-44DB-A233-BE5EA33B914C, and the Office 2016 Activation ID is 98EBFE73-2084-4C97-932C-C0CD1643BEA7.
upk [ActivationID]Uninstalls the product key for Windows (default) or the application that is identified when its Activation ID is provided. The Office 2019 Activation ID is 70512334-47B4-44DB-A233-BE5EA33B914C, and the Office 2016 Activation ID is 98EBFE73-2084-4C97-932C-C0CD1643BEA7.

 

CAUTION: If you intend to uninstall the product key for Office, for example, and forget to enter the Activation ID, all installed product keys are uninstalled. This includes the product key for Windows.

xpr [ActivationID]Displays the expiration date for the current license state.
sprt [PortNumber]Sets the TCP communications port on a KMS host computer. It replaces PortNumber with the TCP port number to use. The default setting is 1688.
cdnsDisables automatic DNS publishing by a KMS host computer.
sdnsEnables automatic DNS publishing by the KMS host computer.
cpriLowers the priority of KMS host computer processes.
sai [ActivationInterval]Changes how often a KMS client attempts to activate itself when it cannot find a KMS host computer. It replaces ActivationInterval with a value expressed in minutes. The default setting is 120 minutes.
sri [RenewalInterval]Changes how often a KMS client attempts to renew its activation by contacting a KMS host computer. It replaces RenewalInterval with a value expressed in minutes. The default setting is 10080 minutes (7 days). This setting overrides the local KMS client settings.

Source: https://docs.microsoft.com/en-us/deployoffice/vlactivation/tools-to-manage-volume-activation-of-office#the-slmgrvbs-script