Flamingo Raises $4.5M Seed Round

Skip to content

How to find a Windows product key in CMD, PowerShell or the registry

Technology
IT Operations
Troubleshooting
"Fae" Grace Meadows"Fae" Grace Meadows
October 6, 2026
392 views
How to find a Windows product key in CMD, PowerShell or the registry

Where a Windows product key lives depends on how the machine was licensed: the exact PowerShell, CMD and registry commands for the firmware key now that wmic is gone, the channel and last five characters with slmgr, what a digital license means, and how KMS, MAK and AD-based activation change the question for a fleet.


Updated: November 2026

A machine needs a rebuild, the sticker is long gone, and the ticket says "find the Windows key" as if it were one thing. There are four places a Windows license can live, and the right command depends on which one you have. This guide covers how to find a Windows 10 product key (and a Windows 11 one) from the firmware, from the registry and from Microsoft's own records, and what to do when every method comes back empty.

The four kinds of Windows license

Microsoft's own support page lists where a product key comes from by how you got Windows: a new PC, a boxed copy, a digital purchase, a free upgrade, a volume agreement. For a technician, that list collapses into four cases, and each one answers "where is the key" differently.

How the machine was licensedWhere the key isWhat you'll find on the device
OEM (bought with Windows preinstalled)Burned into the firmware by the manufacturerA full 25-character key via OA3xOriginalProductKey
Retail (boxed or bought online)On the card in the box, or in the order emailOnly the last five characters, from slmgr /dli
Digital license (free upgrade, Store purchase, or a key that was entered once)Tied to the hardware hash on Microsoft's servers, linked to a Microsoft accountNo key at all. Settings says "activated with a digital license"
Volume (KMS, MAK or Active Directory-based)In the Microsoft 365 admin center's volume licensing pages, or a generic key on the deviceA GVLK or MAK; slmgr /dlv shows the channel

The thing to know before you run anything: a digital license has no key to find. Microsoft's activation page (updated September 2025) describes it as "a method of activation in Windows 11 that doesn't require you to enter a product key". If Settings shows a digital license, the search is over before it starts, and the fix is to link a Microsoft account.

Pull the firmware key from an OEM machine

Since Windows 8, manufacturers have embedded the product key in the firmware under a scheme Microsoft calls OEM Activation 3.0. The key sits in the ACPI table of the motherboard and Windows reads it during setup, which is why a clean install on a Dell or Lenovo activates with no sticker and no typing.

Windows exposes that key through the Software Licensing Service, and PowerShell reads it in one line. The next three sections give the exact commands for PowerShell, Command Prompt and the registry.

A blank line is a result too. It means the firmware carries no key: the machine was never sold with Windows preinstalled, or it was built from parts, or the board was replaced. A blank answer on a machine that is activated points to one of the other three cases.

One caveat that catches people who read the number and stop: the firmware key is the key the machine shipped with. If someone upgraded Home to Pro through the Store, or entered a retail key later, the firmware key still says Home. It tells you what the manufacturer sold, and slmgr /dlv tells you what is running.

Find the product key with PowerShell

PowerShell is the method that works on every current build. Open PowerShell or Windows Terminal and run:

powershell
# The full 25-character key stored in the firmware
(Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey

# Which edition that firmware key is for
(Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKeyDescription

The first line returns the key. The second tells you which edition the manufacturer sold, which matters when the key says Home and the machine runs Pro.

Two variants are worth keeping. On a PC you reach over WinRM, add -ComputerName PC01 to Get-CimInstance and read the key without a remote session. On an old box stuck on Windows PowerShell 2.0, (Get-WmiObject -Query 'select * from SoftwareLicensingService').OA3xOriginalProductKey does the same job. Get-WmiObject doesn't exist in PowerShell 7, so use the CIM version everywhere else.

Find the product key in CMD

The old one-liner was wmic, and on Windows 11 it's gone. Microsoft deprecated WMIC in 2021, and its support article KB5067470 says the August 2026 preview update removed it from Windows 11 versions 24H2 and 25H2, with 26H1 following in September. It's no longer available as a Feature on Demand either. If Command Prompt says "'wmic' is not recognized as an internal or external command", that's the removal at work. WMI itself is untouched, which is why the PowerShell route still works.

From a Command Prompt or a batch file, call PowerShell for the same query:

cmd
:: Windows 10 and 11, any build
powershell -NoProfile -Command "(Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey"

:: Windows 10 machines that still have wmic
wmic path SoftwareLicensingService get OA3xOriginalProductKey

:: The last five characters of the installed key, no admin needed
slmgr /dli

If a script library still calls wmic for licensing or inventory, now is the time to swap it for Get-CimInstance. Microsoft's article points at PowerShell for WMI queries.

Find the product key in the registry

Windows keeps a copy of a product key under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform, in a value called BackupProductKeyDefault. Open regedit and browse there, or read it from a prompt:

cmd
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v BackupProductKeyDefault
powershell
(Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform").BackupProductKeyDefault

Treat that value as a clue to confirm. On a machine with a digital license it can hold a generic key for the edition. Generic keys install an edition and can't activate anything, so typing one into another PC gets you nowhere. The key Windows installed also sits in DigitalProductId under HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion, but it's encoded. Third-party key finders decode that value, and on a digital license they return the same generic key.

So the order is: firmware key with PowerShell, channel and last five with slmgr, registry last. If all three disagree, the purchase record wins.

Read what's installed with slmgr

slmgr.vbs is the script Microsoft ships for the Software Licensing Service, and its display switches don't need elevation. Three are worth memorizing.

cmd
slmgr /dli
slmgr /dlv
slmgr /xpr

/dli shows the edition, the license channel and the last five characters of the installed key. Microsoft's reference describes it as license information "for the installed active Windows edition". Those five characters are enough to match a key against a record in your documentation or a reseller's order history, and they're all Windows will show you for a retail key, because the full key is deliberately not kept in a readable place.

/dlv is the verbose version, and the line to read is the one that names the channel: Retail, OEM:DM (the firmware key), Volume:GVLK (a KMS client) or Volume:MAK. That one word tells you which of the four cases you're in.

/xpr shows the activation expiry. Microsoft notes it is "primarily useful for KMS clients, because MAK and retail activation is perpetual". On a KMS client you'll see a date; on anything else, "permanently activated".

For a one-liner that pairs the installed edition with the firmware key, the PowerShell below reads both classes at once. It's the same pair a sysadmin on r/sysadmin was scripting in March 2025 when their output said Pro on machines that had been upgraded in place to Enterprise, which is the firmware-key caveat again: OA3xOriginalProductKey reports what shipped, SoftwareLicensingProduct reports what's licensed now.

powershell
$lic = Get-CimInstance SoftwareLicensingProduct -Filter "Name like 'Windows%'" |
       Where-Object { $_.PartialProductKey }
[pscustomobject]@{
  Edition    = $lic.Name
  Channel    = $lic.ProductKeyChannel
  Last5      = $lic.PartialProductKey
  Status     = $lic.LicenseStatus      # 1 = licensed
  FirmwareKey = (Get-CimInstance SoftwareLicensingService).OA3xOriginalProductKey
}

Windows 10 product keys after end of support

Windows 10 reached end of support on October 14, 2025. The PC keeps working, and Microsoft's Extended Security Updates (ESU) program brings back security updates with a license of its own, separate from the Windows product key.

  • Consumer ESU has no key. It's tied to the Microsoft account used to enroll from Settings > Update & Security > Windows Update, covers up to 10 devices, and Microsoft's support page says it runs until October 12, 2027.
  • Commercial ESU uses its own Multiple Activation Key from the Microsoft 365 admin center. You install it next to the Windows key with slmgr /ipk, activate it with slmgr /ato and the activation ID for the ESU year, and slmgr /dlv then lists the ESU program by name as Licensed.

Our Windows 10 ESU guide covers pricing, the Year 2 switch and enrolling a fleet. If the PC is eligible for Windows 11 instead, Microsoft's activation page lists a free upgrade from a genuine copy of Windows 10 as activating with a digital license, so there's no new key to find.

When the key is "not available"

Three situations produce an empty result, and they need three different answers.

The firmware returns nothing and Settings says digital license. This is the common one on a machine that took the free Windows 10 or 11 upgrade, or had a key entered once and then forgotten. The license is tied to the hardware hash on Microsoft's side, and the only thing worth doing is linking a Microsoft account to it in Settings. Microsoft's activation page is explicit that linking is what lets the Activation troubleshooter reactivate the machine after a motherboard swap. Document the account.

The firmware returns a key, but the machine won't activate with it. A sysadmin on r/sysadmin lost activation on twelve OEM-licensed blades after the 24H2 update in January 2025, and OA3xOriginalProductKey came back empty while the registry showed a different key than the one that had activated them. The thread below is a useful warning that firmware keys are read at install, and that a later edition upgrade or board change can leave the registry and the firmware disagreeing. In that case the answer was the original keys from the purchase records, which is the point of keeping them.

It's a retail key and the card is gone. Microsoft's support page says it plainly: Microsoft only keeps a record of product keys bought from the Microsoft online store, visible under Order history in the Microsoft account. A key bought from any other retailer lives in that retailer's order email or digital locker. If the box, the email and the locker are all gone, there's no recovery route, and the clean option is to activate with the digital license the machine already earned the first time that key was used.

Fleets with KMS, MAK and the key you never type

On a fleet, reading keys off firmware one machine at a time doesn't scale. Volume activation replaces the per-device key with one of three methods, and each one changes what "find the key" means.

KMS. Client machines carry a Generic Volume License Key (GVLK), which is public and identical on every device of that edition, and activate against a KMS host on your network. The host needs a Customer Specific Volume License Key (CSVLK) from the volume licensing pages of the Microsoft 365 admin center, which took over when Microsoft retired the Volume Licensing Service Center. Microsoft's planning guide (updated 2025) sets the activation threshold at 25 client machines, or 5 servers, before the host will activate anything, and slmgr /xpr on a client shows when its 180-day activation next needs renewing. The "key" on a KMS client is nothing to find; the key that matters is on the host.

MAK. A Multiple Activation Key activates against Microsoft directly, a fixed number of times. Microsoft's guide describes it as working "like a retail key, except that a MAK is valid for activating multiple computers", and points to it for machines that are isolated or too few to reach the KMS threshold. The MAK lives in the Microsoft 365 admin center and in whatever you pushed it with; slmgr /dlv on a client shows Volume:MAK and the last five characters.

Active Directory-based activation. Domain-joined machines activate against an activation object in the forest instead of a KMS host, and Microsoft's guide only asks that they touch a domain controller once every 180 days. No key on the device at all.

The thread below is the fleet version of this whole post: an admin unwinding Enterprise E3 back to Pro, planning to pull the firmware key with OA3xOriginalProductKey and re-inject it with slmgr /ipk. The useful replies point at Microsoft's subscription activation docs, which say the E3 step-up reads the firmware Pro key underneath and steps back down on its own, and warn that a key pushed with /ipk puts a machine on a KMS or MAK channel that unassigning a license group won't undo. Run slmgr /dli first and read the channel before touching anything.

Inventory the keys before the audit asks

The cheap version of all of this is to collect the channel, the last five characters and the firmware key from every machine once, and keep it next to the purchase records. That turns the next rebuild from a search into a lookup, and it's the Windows row of a software license audit answered before anyone sends a letter.

The script below runs on any Windows 10 or 11 device and writes one line per machine. Push it through whatever you use to run scripts across a fleet; OpenFrame, our open, AI-native infrastructure for IT and security, can run it across a client's devices and collect each machine's output in one place.

powershell
$lic = Get-CimInstance SoftwareLicensingProduct -Filter "Name like 'Windows%' and PartialProductKey is not null"
$svc = Get-CimInstance SoftwareLicensingService
[pscustomobject]@{
  Device      = $env:COMPUTERNAME
  Edition     = $lic.Name
  Channel     = $lic.ProductKeyChannel
  Last5       = $lic.PartialProductKey
  Licensed    = ($lic.LicenseStatus -eq 1)
  FirmwareKey = $svc.OA3xOriginalProductKey
  KmsHost     = $svc.KeyManagementServiceMachine
} | ConvertTo-Csv -NoTypeInformation

Two rows deserve a second look when the CSV comes back: a Retail channel with no matching purchase record, and an OEM:DM channel whose firmware key is blank. The first is a key you can't prove you own; the second is a machine that will not reactivate itself after a board swap. Both belong in the same place the IT asset lifecycle records live, because the license outlasts the hardware in one case and dies with it in the other.

Here's a short walkthrough of the Settings and command-line routes on Windows 11 for anyone who wants to see them on screen:

The short version

Check Settings first: if it says digital license, link a Microsoft account and stop looking for a key. On an OEM machine, read the firmware with OA3xOriginalProductKey. On everything else, slmgr /dlv tells you the channel and the last five characters, and the purchase record holds the rest. On a fleet, the key lives on the KMS host or in the Microsoft 365 admin center.

If the search started because a machine needs a fresh install, the factory reset guide covers the reinstall paths that keep the activation.

The PowerShell commands post has the rest of the licensing queries, sorted by the ticket you're on.

"Fae" Grace Meadows

"Fae" Grace Meadows

Lead AI Fairy

Some things defy easy explanation: magic dust, the northern lights… and Flamingo’s AI Angels. Think Charlie’s Angels, reimagined with automation brains and serious RMM (Remote Monitoring & Management) chops. Weird? A little. Effective? Absolutely. That’s the job.

Related Content

Frequently Asked Questions

/blog/how-to-find-windows-product-key

Still deciding?

Ask Mingo answers from our docs and customer stories.

Loading related content and questions