How to Retrieve Windows Server 2008r2 Product Key using Powershell

Magical Jelly Bean key finder and and others like it, as I have just learned, do not work with Windows 2008r2 because MS has encrypted the key in registry.

There are a few pay for programs that can retrieve the key for you, but luckily someone much smarter than me has written a very succinct PS script that returns the key, unencrypted 🙂

You can find the code here, or copy it below.

  • Look in the comments of the above linked page for specific instructions on how to save and run the script (if you’re not to sure on powerscript)

  • Don’t forget to run set-executionpolicy remotesigned first


PS Script: