How to find Windows Product Key Using PowerShell?

PowerShellMicrosoft TechnologiesSoftware & Coding

Windows Product key can be retrieved using PowerShell or CMD. To retrieve the product key using PowerShell, we need to query SoftwareLicesingService class and there is a property called OA3xOriginalProductKey which stores the product key.

Example

Get-WmiObject -query select * from SoftwareLicensingService' | Select OA3xOriginalProductKey

Output

OA3xOriginalProductKey
----------------------
BBBBB-CSDSC-EESSR-KKIDS-AAAAA

We can also query this WMI class using cmd as shown below.

wmic path softwarelicensingservice get OA3xOriginalProductKey`

Caution: It may or may not work for all the Windows OS. The above is tested in Windows 10.

Published on 15-Dec-2020 07:44:41