How to Check Your Windows Product Key Using Powershell and CMD
The Windows product key can be easily found using this short command
You can get your Windows activation key using PowerShell or CMD with just a quick command, no extra tools or installs needed. Whether you’re reinstalling Windows, switching devices, or backing up your license, this guide shows you the easiest ways to find your product key using built-in tools.
Table of contents
How do I use PowerShell to find the Windows key?
1. Use PowerShell to find product key
- Right-click on Start and click on Windows PowerShell (Admin).

- In the PowerShell window, type
powershell "(Get-WmiObject -query ‘select * from SoftwareLicensingService’).OA3xOriginalProductKey" - Press Enter. Your Windows product key will shortly appear.
2. How to find Windows product key using CMD
- In the Windows search box type cmd, right-click the result, and choose Run as administrator. If you can’t start Command Prompt as administrator, check out our guide on how to fix it.

- In the cmd window, type
wmic path softwarelicensingservice get OA3xOriginalProductKey - Press Enter.
- Your Windows product key will show up. It’s in the form of XXXXX-XXXXX-XXXXX-XXXXX-XXXXX.
As you can see, it’s pretty simple to get the Windows serial number with PowerShell. These aren’t the only methods, and we have a great guide on how to view your Windows 11 product key that shows you even more ways to do it.
Keep in mind that issues with product keys can occur, and we wrote guides on what to do if the Windows product key not working or if the Product key can’t be used on this copy of Windows.
We also have a great article on how to find your serial number on Windows 11, so don’t miss it for more information.
If you have any other questions regarding the Windows product key, please leave them in the comments section below.
Read our disclosure page to find out how can you help Windows Report sustain the editorial team. Read more
User forum
7 messages