slmgr Commands Reference: Managing Windows Activation from the Command Line

slmgr Commands Reference: Managing Windows Activation from the Command Line

WindowsKMS

slmgr.vbs (Software License Manager) is the built-in Windows script for every licensing operation: installing product keys, activating, checking status, configuring KMS hosts, and resetting activation state. Every command below requires an elevated Command Prompt or terminal. For the complete annotated reference with examples for every flag, see the slmgr commands reference.

Viewing License Information

slmgr /dli
slmgr /dlv
slmgr /xpr

/dli shows the current edition, partial product key, and license status. /dlv expands this with the activation ID, installation ID, KMS host details, and renewal interval. /xpr reports the exact activation expiration date - permanently activated systems report exactly that.

Installing and Activating Keys

slmgr /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX
slmgr /ato

/ipk installs a product key - for volume activation this is the GVLK matching your edition. /ato triggers online activation immediately against the configured activation service.

Configuring the KMS Host

slmgr /skms kms.example.com:1688
slmgr /ckms

/skms sets the KMS host name (and optionally port) that the client will contact. /ckms clears the custom host and returns to DNS-based auto-discovery via the _vlmcs._tcp SRV record.

Reset and Removal

slmgr /rearm
slmgr /upk
slmgr /cpky

/rearm resets licensing state and the activation grace timer (limited uses). /upk uninstalls the current product key. /cpky additionally removes the key from the registry to prevent theft on decommissioned machines.

The Office Equivalent: ospp.vbs

Microsoft Office volume editions use a parallel script, ospp.vbs, located in the Office installation folder. Common usage: cscript ospp.vbs /dstatus to view Office license state, and cscript ospp.vbs /act to activate.

If activation fails with an error code, each hexadecimal code maps to a specific failure cause - DNS resolution, KMS unavailability, access denied, or edition mismatch. The Windows activation errors index documents the fix for every common code including 0xC004F074 and 0x8007232B.

Report Page