Author Posts

March 15, 2018 at 1:34 pm

We have an upcoming Microsoft audit coming, and I'm trying to get ready for that by getting the serial numbers for all Windows devices in the company.

I noticed that

(Get-WmiObject -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey

will give me the activation key for Windows 7, but not for Windows server editions. Ayy ideas?

Also, we have a couple of Windows XP in the company. It seems like they won't even run PowerShell.

March 15, 2018 at 1:50 pm

Windows XP...no comment

In regards to your server license. Do you have a KMS server by chance? If so, check KeyManagementServiceProductKeyID

You could also just run your wmi query without the OA3xOriginalProductKey and see what returns from that query and find the right attribute.

March 15, 2018 at 1:57 pm

No KMS server

I ran the query without OA3xOriginalProductKey, and there's no OA3xOriginalProductKey

it has ClientMachineID, TokenActivationGrantNumber, TokenActivationLVID, VLActivationInterval etc, but which one is the OS key?

March 15, 2018 at 2:08 pm

SoftwareLicensingService

Try this:

 (get-itemproperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").productid

March 15, 2018 at 2:11 pm

I tried (get-itemproperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").productid

But, it doesn't have a .productid

the only value with a number is BuildGUID. Is that the same as OS key?

March 15, 2018 at 2:17 pm

I honestly don't know.

If you go to system in control panel. What does it say for your product ID? Does it match anything you see in the registry or the WMI query? If so, well there is your answer as to what the product key. If not, you might want to take whatever that value is, and search the registry for it. Then you will know the key it is associated with and can query it on all the other machines.

March 15, 2018 at 2:27 pm

ok thank you. No, I don't see the product ID in the query. I'll do some more research, thanks.