A while back Stacy asked:
"Hi Steve. I was wondering if you knew of a way to get a windows product key from a script. I need it because we are trying to audit our windows licensing, and see if we have any duplicate keys" And by coincidence, I got this email from Matthew P:
"Do you guys have a quick tool to see what model a computer is?
Just as soon as I typed this I remembered I already have a tool for this sort of thing, and I'm attaching it now..." The real gem in Matthew's script is the ability to pull out a Windows product key.
This info is located in the registry under
HKLM\Software\Windows NT\CurrentVersion With a value of:
DigitalProductId
If you look at it, you will realize it is encrypted:
That is what his script takes care of. It reverses the simple XOR encryption and turns that numeric mess into a readable product key.
You can get the script from here:
GetProductKey.dat Just rename to .vbs, and it outputs the OS version, and key to the console.
Steve Wiseman
http://www.intelliadmin.com
No comments:
Post a Comment