OSPP Command Reference
ospp.vbs — Office Software Protection Platform script
ospp.vbs is the Office Software Protection Platform script used to manage the activation state of volume editions of Microsoft Office. It is installed alongside volume Office and located in the version-appropriate Office installation directory — for example %ProgramFiles%\Microsoft Office\Office16\ospp.vbs for Office 2016 through Office LTSC 2024.
It performs the equivalent of slmgr.vbs for Office: install or remove product keys, set a KMS host name, trigger activation, and report licence status. The script is only present in Volume Licensed installations of Office; Click-to-Run consumer builds use a separate activation mechanism tied to the user's Microsoft 365 subscription.
See also: slmgr Command Reference, GVLK Keys, Software Protection Platform.
History
ospp.vbs was introduced with Office 2010 alongside Office volume activation, which moved Office from the per-installation product key model used by Office 2007 and earlier to a KMS / MAK / AD-BA model parallel to that used by Windows. The script has been carried forward in every subsequent Office LTSC release (2013, 2016, 2019, 2021, 2024) with no breaking changes.
Technical details
The script must be invoked from the Office installation directory, or its full path supplied, because it locates the licensing components by relative path. State-modifying operations require an elevated command prompt. Underlying state is held by the same sppsvc service that manages Windows licensing; Office activations appear alongside Windows activations in slmgr.vbs /dlv all output as additional ActivationID entries.
Common options
| Switch | Description |
|---|---|
/inpkey:<Key> | Install the specified Office product key. |
/unpkey:<Last5> | Uninstall the product key identified by its last five characters. |
/act | Activate installed Office product keys. |
/dstatus | Display licensing information for installed product keys. |
/dstatusall | Display licensing information for all installed product keys. |
/sethst:<Value> | Set a KMS host name for Office KMS activation. |
/setprt:<Port> | Set the KMS host port (default 1688). |
/remhst | Remove the KMS host name, reverting to DNS auto-discovery. |
/cachst:<TRUE|FALSE> | Enable or disable KMS host caching. |
/actype:<1|2|3> | Set the activation type (1 = AD-BA, 2 = KMS, 3 = token). |
/rearm | Reset the licensing status for all installed Office product keys. |
/ddescr:<ErrorCode> | Display the description for the specified error code. |
Examples
cd "%ProgramFiles%\Microsoft Office\Office16" REM Switch a MAK-activated install to KMS by installing the GVLK cscript ospp.vbs /inpkey:FXYTK-NJJ8C-GB6DW-3DYQT-6F7TH REM Point the client at a specific KMS host and activate cscript ospp.vbs /sethst:kms.contoso.example cscript ospp.vbs /act REM Inspect the result cscript ospp.vbs /dstatus
Common issues
- Script not found. The Office installation is Click-to-Run consumer, which does not include
ospp.vbs. Volume activation is only supported on Volume Licensed builds delivered via the Office Customization Tool or the Microsoft 365 Apps for enterprise channel configured for volume activation. 0xC004F074on /act. No reachable KMS host; verifynslookup -type=srv _vlmcs._tcp.<domain>returns a record and that the host has been activated with an Office KMS Host key.- Activation type stuck at AD-BA. Use
/actype:2to force KMS,/actype:1to force AD-BA, and/actype:0(omitted on newer releases) to clear the override. - Mixed key installation. Office permits multiple product keys per installation;
/dstatusallreveals stale MAK keys that may need to be removed with/unpkeybefore KMS activation succeeds.
References
- Tools to manage volume activation of Office — https://learn.microsoft.com/en-us/deployoffice/vlactivation/tools-to-manage-volume-activation-of-office
- Use the Volume License Pack to activate Office — https://learn.microsoft.com/en-us/deployoffice/vlactivation/configure-a-kms-host-computer-for-office
- GVLKs for Office — https://learn.microsoft.com/en-us/office/troubleshoot/activation/gvlks-for-office
- Plan volume activation of Office — https://learn.microsoft.com/en-us/deployoffice/vlactivation/plan-volume-activation-of-office