Slmgr.vbs options for getting volume activation information (2023)

  • Article
  • 10 minutes to read
  • Applies to:
    Windows Server 2012 R2, Windows 10, Windows 8.1

The Slmgr.vbs script syntax is described below, and the tables in this article describe each command-line option.

slmgr.vbs [<computer name> [<username> <password>]] [<options>]

Use

In this article, square brackets [] include optional arguments, and angle brackets <> include wildcards. When entering these declarations, omit the parentheses and replace the placeholders with the appropriate values.

Using Slmgr on remote computers

To manage remote clients, use Volume Activation Management Tool (VAMT) version 1.2 or later, or create custom WMI scripts that respect platform differences. For more information about WMI methods and properties for volume activation, seeWMI properties and methods for volume activation.

Important

Due to WMI changes in Windows 7 and Windows Server 2008R2, the Slmgr.vbs script is not designed to work across platforms. Using Slmgr.vbs to manage a Windows7 or Windows Server 2008R2 system through the WindowsVista® operating system is not supported. When you try to manage an older Windows7 or Windows Server 2008R2 system, a version-specific error is generated. for example runningcscript slmgr.vbs <view_machine_name> /dlvproduces the following output:

Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved.

The remote computer is not compatible with this version of SLMgr.vbs

Slmgr.vbs General Options

possibilityDescription
[<Computer name>]Remote computer name (default is local computer)
[<user>]Account that has the required permissions on the remote computer
[<password>]Password of the account that has the required permissions on the remote computer

global options

possibilityDescription
/ipk<product key>Attempt to install a 5x5 product key. The product key provided by the parameter is confirmed as valid and applied to the installed operating system.
Otherwise, an error is returned.
If the key is valid and applicable, the key will be installed. If a key is already installed, it will be silently replaced.
To avoid license service instability, the system or software protection service must be restarted.
This operation must be performed from an elevated command prompt window or the Standard User Operations registry value must be set to allow unprivileged users additional access to the software protection service.
/ato[<Activation ID>]For retail and volume systems that have a KMS host key or multiple activation key (MAK) installed,/atoasks Windows to attempt online activation.
For systems that have a Generic Volume License Key (GVLK) installed, this will result in a KMS activation attempt. Systems configured to suspend automatic KMS activation attempts (/interrupted) Try KMS activation anyway/atocorre.
Use:Starting with Windows 8 (and Windows Server 2012), the/interruptedThe option is deprecated. Use the/type of actoption instead.
parameter <Activation ID> expanded/atoSupport for identifying a Windows edition installed on the computer. The specification of <Activation ID> The parameter isolates the option's effect on the edition associated with that activation ID. to runslmgr.vbs /dlv todoto retrieve activation IDs for the installed version of Windows. If you need to support other applications, refer to that application's manual for further instructions.
KMS activation does not require elevated privileges. However, online activation requires an elevation or default user operations registry value to be set to allow unprivileged users additional access to the software protection service.
/dli[<activation id>|all]Show license information.
By default,/dlidisplays license information for the active edition of Windows installed. The specification of <Activation ID> The parameter displays the license information for the specified edition associated with this Activation ID. specificationanas the parameter displays license information for all corresponding installed products.
This operation does not require elevated privileges.
/dlv[<Activation ID>|All]View detailed license information.
By default,/dlvdisplays the license information for the installed operating system. The specification of <Activation ID> The parameter displays the license information for the specified edition associated with this Activation ID. specifying theanThe parameter displays license information for all corresponding installed products.
This operation does not require elevated privileges.
/xpr [<Activation ID>]Veja a data de expiração da ativação do produto. Por padrão, isso se refere à edição atual do Windows e é útil principalmente para clientes KMS, pois a MAK e a ativação de varejo são perpétuas.
The specification of <Activation ID> The parameter indicates the activation expiration date of the specified edition associated with this activation ID. This operation does not require elevated privileges.

extended options

possibilityDescription
/cpkySome maintenance operations require the product key to be available in the registry during out-of-the-box operations (OOBE). The/cpkyThe option removes the product key from the registry to prevent malicious code from stealing the key.
For retail installations that provide keys, best practices recommend running this option. This option is not required for MAK and KMS host keys as this is the default behavior for these keys. This option is only required for other key types whose default behavior is not to delete the registry key.
This operation must be performed in an elevated Command Prompt window.
/ilc<license file>This option installs the license file specified by the mandatory parameter. These licenses can be installed as a troubleshooting measure, to support token-based activation, or as part of a manual installation of an integrated application.
Licenses are not validated during this process: License validation is outside the scope of Slmgr.vbs. Instead, validation is performed by the Software Protection Service at runtime.
This operation must be performed from an elevated Command Prompt window or theStandard User OperationsThe registry value must be set to allow unprivileged users additional access to the software protection service.
/firstThis option reinstalls all licenses stored in %SystemRoot%\system32\oem and %SystemRoot%\System32\spp\tokens. These are "known" copies saved during installation.
All corresponding licenses in the Trusted Store will be replaced. Any additional licenses, for example Trusted Authority (TA) Essence Licenses (IL), Application licenses are not affected.
This operation must be performed in an elevated Command Prompt window or in theStandard User OperationsThe registry value must be set to allow unprivileged users additional access to the software protection service.
/if prepareThis option resets activation timers. The/if prepareThe process is also invoked bysysprep / generalize.
This operation does not matter if theHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\SkipRearmregistry entry is set1. verVolume Activation Log Configurationfor details about this registry entry.
This operation must be performed in an elevated Command Prompt window or in theStandard User OperationsThe registry value must be set to allow unprivileged users additional access to the software protection service.
/rearm-app <application id>Resets the license status of the specified application.
/rearm-sku <application id>Resets the license status of the specified SKU.
/upk[<application id>]This option uninstalls the product key for the current edition of Windows. After a reboot, the system will be in an unlicensed state unless a new product key is installed.
Optionally, you can use the <Activation ID> Parameter to specify another installed product.
This operation must be performed from an elevated command prompt window.
/dti[<Activation ID>]Displays the installation ID for offline activation.
/atp <id do commit>Activate the product using the user-supplied confirmation ID.

KMS client options

possibilityDescription
/skms <name[:port]|:port> [<activation id>]This option specifies the name and, optionally, the port of the KMS host computer to be contacted. Setting this value disables automatic detection of the KMS host.
If the KMS host uses Internet Protocol version 6 (IPv6) only, the address must be specified in the format <hostname>:<port>. IPv6 addresses contain colons (:), which are not parsed correctly by the Slmgr.vbs script.
This operation must be performed in an elevated Command Prompt window.
/skms-domain<FQDN> [<Activation ID>]Defines the specific DNS domain where all KMS SRV records can be found. This setting has no effect if the specific individual KMS host is configured using/skmsPossibility. Use this option, especially in disjoint namespace environments, to force KMS to ignore the DNS suffix search list and instead look for KMS host records in the specified DNS domain.
/ckms[<Activation ID>]This option removes the specified KMS hostname, address, and port information from the registry and restores the KMS autodiscover behavior.
This operation must be performed in an elevated Command Prompt window.
/skhcThis option enables KMS host caching (default). Once the client discovers a functioning KMS host, this setting prevents Domain Name System (DNS) priority and weight from affecting communication with the host. If the system can no longer communicate with the functioning KMS host, the client will attempt to discover a new host.
This operation must be performed in an elevated Command Prompt window.
/ckhcThis option disables KMS host caching. This setting instructs the client to use DNS autodiscover whenever it tries to activate KMS (recommended when using priority and weight).
This operation must be performed in an elevated Command Prompt window.

KMS-Hostkonfigurationoptions

possibilityDescription
/exit<Interval>This option sets the interval, in minutes, that non-activated clients attempt to connect to KMS. The activation interval should be between 15 minutes and 30 days, although the default value (two hours) is recommended.
The KMS client first retrieves this range from the log, but switches to the KMS configuration after receiving the first KMS response.
This operation must be performed in an elevated Command Prompt window.
/sri <Interval>This option sets the renewal interval, in minutes, that activated clients attempt to connect to KMS. The renewal interval must be between 15 minutes and 30 days. This option is initially configured on both the KMS server and the client side. The default is 10080 minutes (7 days).
The KMS client first retrieves this range from the log, but switches to the KMS configuration after receiving the first KMS response.
This operation must be performed in an elevated Command Prompt window.
/sprt<Porto>This option specifies the port on which the KMS host listens for client activation requests. The default TCP port is 1688.
This operation must be performed from an elevated command prompt window.
/sdnsEnable DNS publishing by KMS host (default).
This operation must be performed in an elevated Command Prompt window.
/cdnsDisable DNS publishing by the KMS host.
This operation must be performed in an elevated Command Prompt window.
/spriSet the KMS priority to normal (default).
This operation must be performed in an elevated Command Prompt window.
/cpriSet the KMS priority to low.
Use this option to minimize KMS conflicts in a co-hosted environment. Note that this can starve KMS depending on what other applications or server roles are active. Use with care.
This operation must be performed in an elevated Command Prompt window.
/act-type [<activation type>] [<activation id>]This option sets a registry value that limits volume activation to a single type. activation type1restricts activation to Active Directory only;2limits you to KMS activation;3for token-based activation. The0The option allows any type of activation and is the default value.

Token-based activation configuration options

possibilityDescription
/little bitList installed emission allowances for token-based activation.
/ril<ILID><ILvID>Remove an installed token-based activation issuance license.
This operation must be performed from an elevated command prompt window.
/interrupteddefine thoseToken based activation onlyCheck to disable automatic KMS activation.
This operation must be performed in an elevated Command Prompt window.
This option has been removed in Windows Server 2012 R2 and Windows 8.1. Use the/act–Dicaoption instead.
/ctaoremove thoseToken based activation onlyFlag (default), enables automatic KMS activation.
This operation must be performed in an elevated Command Prompt window.
This option has been removed in Windows Server 2012 R2 and Windows 8.1. Use the/act–Dicaoption instead.
/ltcList valid token-based activation certificates that can activate installed software.
/fta <Zertifikat-Thumbprint> [<PIN>]Apply token-based activation using authenticated certificate. The optional personal identification number (PIN) is used to unlock the private key without a PIN prompt when using hardware-protected certificates (eg smart cards).

Active Directory-based activation configuration options

possibilityDescription
/ad-activation-online <product key> [<activation object name>]Collects data from Active Directory and starts activating the Active Directory forest with credentials run from a command prompt. Local administrator access is not required. However, read/write access to the activation object container in the forest root domain is required.
/Ad-Activation-get-IID <product key>This option initiates activation of the Active Directory forest in phone mode. The result is the Installation ID (IID) that can be used to activate the forest over the phone when no Internet connection is available. After the IID is provided in the activation call, a CID is returned which is used to complete the activation.
/ad-activation-apply-cid <product key> <confirmation id> [<activation object name>]If you use this option, enter the CID received in the activation call to complete the activation
[/name: <AO_Name>]You can optionally attach the/NameOption for each of these commands to specify a name for the activation object stored in Active Directory. The name cannot exceed 40 Unicode characters. Use double quotes to explicitly define the name string.
On Windows Server 2012 R2 and Windows 8.1, you can add the name right after/ad-activation-online <Product Key>y/ad-activation-apply-cidwithout having to use them/NamePossibility.
/to-listShows all available activation items for the local computer.
/del -ao <AO_DN>
/del-ao <AO_RDN>
Removes the specified activation object from the forest.

additional references

  • Volume Activation Technical Reference
  • Volume Activation Overview

Comment

Send and view feedback to

This ProductThis page

Top Articles
Latest Posts
Article information

Author: Moshe Kshlerin

Last Updated: 03/29/2023

Views: 6304

Rating: 4.7 / 5 (57 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Moshe Kshlerin

Birthday: 1994-01-25

Address: Suite 609 315 Lupita Unions, Ronnieburgh, MI 62697

Phone: +2424755286529

Job: District Education Designer

Hobby: Yoga, Gunsmithing, Singing, 3D printing, Nordic skating, Soapmaking, Juggling

Introduction: My name is Moshe Kshlerin, I am a gleaming, attractive, outstanding, pleasant, delightful, outstanding, famous person who loves writing and wants to share my knowledge and understanding with you.