Read Windows keys from system and BIOS.
In this blog post, I will show you how to read Windows keys from the system and BIOS using PowerShell. This can be useful if you need to recover your Windows product key for backup or activation purposes.
The first step is to import the SoftwareLicensingProduct module, which contains the Get-WmiObject cmdlet that can access Windows licensing information. You can run the following command in a PowerShell window:
The next step is to use the Get-WmiObject cmdlet with the -Class parameter set to SoftwareLicensingProduct. This will return a list of objects representing different software products installed on your system. You can filter the list by using the -Filter parameter and specifying the PartialProductKey property, which contains the last five characters of the product key. For example:
shell power
Import module softwareLicenseProduct
If you are using Windows 10 or 11, you may not need to enter the license key more than once. The first time you install the operating system, it will activate and store your computer's information in a Microsoft database. This way, if you reinstall Windows later, it will automatically activate again. However, if you change some important hardware components such as the motherboard, you may need to contact Microsoft support through the “Activation Settings” in the Settings app.
How to view your Windows key
Windows Key Viewer is a simple tool that can help you find your Windows license key. You don't need to install anything, just run the program and it will show you the key immediately. You can also copy it to the clipboard and save it somewhere else or print it.
But what if your computer came with Windows preinstalled? In that case, the key may be stored in the BIOS/UEFI and not accessible by external tools. Don't worry, there is a command that can reveal it. All you need to do is open the command prompt by typing cmd and then type wmic path softwarelicensingservice get OA3xOriginalProductKey and press Enter. You should see your key on the screen.