May 7, 2014 - Warren Held

Retrieve Windows Product Keys With PowerShell

If you are looking to retrieve Windows XP, Windows 7, Windows Vista, Server 2003, Server 2008, or Server 2012 product keys and remotely over the network or locally then this PowerShell script will simplify this task.  I used chunks of PowerShell code from here for the Get-ProductKey function.  WinRM has to be enabled on the computers you are trying to retrieve product keys from.  The easiest way to enable WinRM is to open a PowerShell prompt on the computer and run:

You can copy and paste this code into notepad and save it with a .ps1 extension.  Then right click on the file and select ‘Run with PowerShell’.  You’ll need to change localhost to a comma seperated list of computer names that you want to retrieve the Windows product key from, and supply domain administrator credentials in the form of domain\user.

 

Uncategorized PowerShell /