btnhd / BTNHD

All files (notes, scripts, and reference links) used within YouTube videos are placed here.
68 stars 38 forks source link

Incorrect installed key #1

Open blackwatercitadel opened 6 years ago

blackwatercitadel commented 6 years ago

When I run the script it is showing the Installed Key as BBBBB-BBBBB-BBBBB-BBBBB-BBBBB. But if I run the following commands I get the correct key.

From CMD: wmic path softwarelicensingservice get OA3xOriginalProductKey

From PowerShell: powershell "(Get-WmiObject -query ‘select * from SoftwareLicensingService’).OA3xOriginalProductKey"

dionindahub commented 1 year ago

I had this issue when I tried to get the Product Keys from Enterprise editions of Win7 and Win10. It turned out it's not a problem of the script, it's the value of HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId that, when decoded, returns BBBBB-BBBBB-BBBBB-BBBBB-BBBBB, and I think that happens because it's a bulk license. Note that I got the same results (all Bs) by running AIDA64 on the same machine.

What this VBScript does is it decodes the registry key mentioned above to return the currently used product key.

The wmic query you mention returns the Original Product Key, i.e. the product key put by the OEM when the machine was shipped. This might be the key currently in use, but it's the case necessarily.

For example, your organisation bought some laptops in a lucrative price but they came with Windows 10 Home pre-installed. Then you installed Windows 10 Pro so that they can connect to your org's AD. If you query wmic you'll get the Win 10 Home key, while if you run the VBScript you'll get the Win 10 Pro key. And if, instead of Win 10 Pro keys, you used your org's bulk licensed Win 10 Enterprise key, you'll get all Bs from the VBScript.