SoFunction
Updated on 2025-04-10

Office batch activation command tool ospp detailed explanation

Office Software Protection Platform Scripts () enable you to configure volume-licensed versions of Office products, including Project and Visio.

script

The script is located inProgram Files\Microsoft Office\Office16orProgram Files (x86)\Microsoft Office\Office16Folder.

Applicable to: Volume Licensed Versions of Office 2019 and Office 2016 (including Project and Visio)

Run Required Script Engine

To view the help file, type the following command and press Enter:

cscript /?

The regular syntax is as follows:

 cscript [Option:Value] [ComputerName] [User] [Password]

Option: Specify options and values ​​for: Activate the product, install or uninstall the product key, install and display license information, set the KMS hostname and port, and delete the KMS hostname and port. These options and values ​​are listed in the tables in this section.

ComputerName: The name of the remote computer. If the computer name is not provided, use the local computer.

User: The account that has the required permissions on the remote computer.

Password: The password of the account. If the user account and password are not provided, the current credentials are used.

Global options

Global Options illustrate
/act Activate the installed Office product key.
/inpkey:value Install the product key (replaces existing keys) using the user-provided product key. The Value option is required.
/unpkey:value Uninstall the installed product key (including the last five digits of the product key to be uninstalled, as shown in the /dstatus option). Value parameter is required.
/inslic:value Install the license using the user-provided .xrm-ms license path. Value parameter is required.
/dstatus Displays license information for installed product keys.
/dstatusall Displays license information for all installed licenses.
/dhistoryacterr Shows the history of failures for MAK/retail activation.
/dinstid Displays the installation ID for offline activation.
/actcid:value Activate the product using the user-provided confirmation ID. Value parameter is required.
/rearm Reset the license status of all installed Office product keys.
/rearm:value Resets the license status of the Office license with the SKUID value provided by the user. Value parameter is required.
/ddescr:value Displays a description of the error code provided by the user. Value parameter is required.

KMS client options

KMS Client Options illustrate
/dhistorykms Displays the KMS client activation history.
/dcmid Displays the KMS client computer ID (CMID).
/sethst:value Set the KMS hostname with the user provided hostname. The Value parameter is required. This will set HKLM\Software\Microsoft\OfficeSoftwareProtectionPlatform\KeyManagementServiceName (REG_SZ) .
/setprt:value Set the KMS port using the user-provided port number. The default port number is 1688. The Value parameter is required. This will set HKLM\Software\Microsoft\OfficeSoftwareProtectionPlatform\KeyManagementServicePort (REG_SZ) .
/remhst Delete the KMS hostname and set the port to the default value. The default port is 1688.
/cachst:value Allow or deny KMS host cache. The Value parameter is required (TRUE or FALSE).
/actype:value Set the batch activation type. Value parameter is required. Values: 1 (indicated based on Active Directory), 2 (indicated KMS), 0 (indicated both).
/skms-domain:value Set up a specific DNS domain where all KMS SRV records are found. This setting does not work if a particular KMS hostname is set by the /sethst option. The Value parameter is a fully qualified domain name (FQDN) and is required.
/ckms-domain Clear a specific DNS domain where all KMS SRV records are found. If a specific KMS host is set by the /sethst option, that host is used. Otherwise, automatic discovery of the KMS host will be used.

Used scheme

Change the product key to the MAK key on the remote computer

1. If the remote computer is named contoso1, run the following command to enter the product key. This assumes that you have administrator credentials on the remote computer. If you are remote

The credentials on your computer are different from your login and password, you must type your login and password in the command line and press Enter:

cscript /inpkey:xxxxx-xxxxx-xxxxx-xxxxx-xxxxx contoso1

2. To activate the remote computer, type the following command and press Enter:

cscript /act contoso1

Diagnosing KMS activation errors

1. If the computer has the KMS client key installed, check the authorization status. To do this, type the following command and press Enter:

cscript /dstatusall

To check the KMS activation history, type the following command and press Enter:

cscript /dhistorykms

To trigger activation, type the following command and press Enter:

cscript /act

Check for error message for error code 0xC004F042. If you see an error code displayed to the user in the notification dialog box, you can also use the code to check for error messages. To do this, type the following command and press Enter:

cscript /ddescr:0xC004F042

Turn on or off the KMS host cache on the KMS client on the KMS client computer. To turn on the cache, type the following command, and press Enter:

cscript /cachst:TRUE

On the KMS client computer, to turn off the cache, type the following command, and then press Enter:

cscript /cachst:FALSE

Test the KMS host name and set to Automatic Discovery If you test the KMS host with the name and to specify the host in the KMS client, type the following command and press Enter:

cscript /sethst:

To trigger activation, type the following command and press Enter:

cscript /act

To check the KMS activation history to see if the host is connected successfully, type the following command and press Enter:

cscript /dhistorykms

You now want this KMS client to automatically discover production KMS hosts using the Domain Name System (DNS). To remove the KMS host name, type the following command and press Enter:

cscript /remhst

Summarize

This is the article about the command tool for office batch activation. This is all about the article about ospp. For more related Office batch activation tool content, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!