Get SQL Server Product Keys for Local and Remote Servers using PowerShell

I just released a new PowerShell script, Get-SQLServerKeys.ps1. The script works works with several versions of SQL Server (2005-2014), and can use Central Management Server, a text file, or just a string of servers as input.

sql6

Like many of the Windows Key scripts available, this one relies on Remote Registry being enabled. However, if you’ve disabled this service, you can run Get-SQLServerKeys.ps1 on the SQL Server itself and all keys will be extracted for all local instances by accessing the registry directly.

sql7

Thanks goes out to Jakob Bindslet for providing the key decode function.

Get-SQLServerKeys.ps1 is one of several scripts that help DBA’s migrate SQL Servers. Check out my sqlmigration repository on github for more scripts.

Chrissy is a Cloud and Datacenter Management MVP who has worked in IT for over 20 years. She is the creator of the popular SQL PowerShell module dbatools, and holds a number of certifications, including those relating to SQL Server, Linux, SharePoint and network security. You can follow her on Twitter at @cl.

Posted in PowerShell, SQL Server
3 comments on “Get SQL Server Product Keys for Local and Remote Servers using PowerShell
  1. Great script Chrissy, thanks for sharing.
    Nice to see someone make real use of my PowerShell bits and pieces :-)

  2. Brian says:

    This help me a lot. Thank you!

  3. Rob says:

    Sorry, doesn’t do squat when I run it directly on the SQL 2014 server.

1 Pings/Trackbacks for "Get SQL Server Product Keys for Local and Remote Servers using PowerShell"

Leave a Reply

Your email address will not be published. Required fields are marked *

*