What This Command Actually Retrieves
Since Windows 8, OEM manufacturers embed the product key directly in the motherboard's UEFI firmware (in an ACPI table called MSDM) rather than printing it on a sticker. Windows reads that embedded key automatically during installation, which is why a factory-installed copy of Windows activates itself with no key entry required. A single WMI query can pull that embedded key back out, which is useful if you're reinstalling Windows from scratch and need the key on hand, or just archiving it before you get rid of a machine.
Method 1: Command Prompt (wmic)
Open Command Prompt — Start menu, type cmd, and it doesn't need to be run as administrator for this particular query. Run:
wmic path softwarelicensingservice get OA3xOriginalProductKey
If a key is embedded in firmware, it prints directly under the header line in the standard 5x5 format (XXXXX-XXXXX-XXXXX-XXXXX-XXXXX).
wmic since Windows 10 21H1 and it's removed by default starting with some Windows 11 24H2 builds. If the command above returns "not recognized," use the PowerShell method below instead — it queries the exact same underlying data.
Method 2: PowerShell (Works Everywhere wmic Doesn't)
Open PowerShell (Start menu, type powershell) and run:
(Get-CimInstance -Query 'select * from SoftwareLicensingService').OA3xOriginalProductKey
This calls the same WMI class (SoftwareLicensingService) that wmic was querying, just through the modern CIM cmdlets that replace it. It works identically on Windows 10 and Windows 11 and isn't affected by the wmic deprecation.
Checking Your Current Activation Status Instead
If what you actually need is confirmation that Windows is activated — rather than the raw key itself — slmgr (Software Licensing Manager) is the more direct tool. Run from an elevated Command Prompt:
slmgr /xpr
This pops up a dialog telling you whether Windows is permanently activated or when a subscription/trial-based activation expires. For a fuller license report including the partial product key currently in use (Microsoft masks most of it for security, showing only the last 5 characters):
slmgr /dlv
Why the Full Key Sometimes Doesn't Match What's Installed
If you've ever upgraded your Windows edition (Home to Pro, for instance) using a separate product key, the OEM key embedded in firmware is still the original key the machine shipped with — the WMI query above always returns that original OA3 key, not whatever key you entered later during an edition upgrade. In that case, the currently active license is tracked separately by Microsoft's activation servers against your hardware ID, and there's no local command that extracts a key you never manually entered in the first place, since digital licenses by design don't store a retrievable literal key on the machine.
Saving the Key Somewhere Useful
If you're about to wipe a drive and want the key on record, don't rely on a screenshot alone — pipe it straight into a text file so it survives a reboot into a recovery environment where you might not have your screenshot handy:
(Get-CimInstance -Query 'select * from SoftwareLicensingService').OA3xOriginalProductKey | Out-File "$env:USERPROFILE\Desktop\product-key.txt"
Store that file somewhere other than the machine you're about to reinstall — a cloud drive, a USB stick, or password manager note — since the whole point is having it available after the local disk is gone.
Discussion & Insights