Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Get your 25-character Product ID using PowerShell

30 Apr 2012   #1

MS Windows 7 Ultimate SP1 64-bit
Get your 25-character Product ID using PowerShell

I ran across an interesting little PowerShell script to get your 25-character Product ID.

I realize and am very familiar with other ways of fetching this ID, but for you PowerShell fans, here is a method that requires no 3rd party software but simply PowerShell which comes with your Win 7.

functionGet-ProductKey { $map="BCDFGHJKMPQRTVWXY2346789"$value= (get-itemproperty"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").digitalproductid[0x34..0x42] $ProductKey=""for ($i=24;$i-ge0;$i--) { $r=0for ($j=14;$j-ge0;$j--) { $r= ($r*256) -bxor$value[$j] $value[$j] = [math]::Floor([double]($r/24)) $r=$r%24 } $ProductKey=$map[$r] +$ProductKeyif (($i%5) -eq0-and$i-ne0) { $ProductKey="-"+$ProductKey } } $ProductKey }

Now here is the source link for that script, that credit may be given where credit is due.

Getting Windows Product Key - Power Tips -

My System SpecsSystem Spec


 Get your 25-character Product ID using PowerShell

Thread Tools

Similar help and support threads for2: Get your 25-character Product ID using PowerShell
Thread Forum
Solved Product key giving product is upgrade not clean install on activation Windows Updates & Activation
character map copy General Discussion
Character Problem Music, Pictures & Video
Powershell get-acl help Software
Product Key Does Not Match Current Windows SKU (Foreign product key?) Software
Slow deletes (character by character) General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 09:22 PM.
Twitter Facebook Google+

Windows 7 Forums

Seven Forums Android App Seven Forums IOS App

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33