dbatools is a free PowerShell module with over 300 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


Get-DbaSqlProductKey

Using a string of servers, a text file, or Central Management Server to provide a list of servers, this script will go to each server and get the product key for all installed instances. Clustered instances are supported as well.
Requires regular user access to the SQL instances, SMO installed locally, Remote Registry enabled and accessible by the account running the script.

Uses key decoder by Jakob Bindslet (http://goo.gl/1jiwcB)

Screenshots

dbatools-Get-DbaSqlProductKey

Examples

Gets SQL Server versions, editions and product keys for all instances within each server or workstation.

Get-DbaSqlServerKey winxp, sqlservera, sqlserver2014a, win2k8

Gets SQL Server versions, editions and product keys for all instances within sqlserver01’s Central Management Server.

Get-DbaSqlServerKey -SqlCms sqlserver01

Gets SQL Server versions, editions and product keys for all instances listed within C:\Scripts\servers.txt.

Get-DbaSqlServerKey -ServersFromFile C:\Scripts\servers.txt

Author

This command was created by Chrissy LeMaire. You can find Chrissy on Twitter and his blog.

Get-Help

From PowerShell, execute Get-Help Get-DbaSqlProductKey -Detailed for more information on this function.

Source Code

Want to see the source code? View Get-DbaSqlProductKey.ps1 on GitHub
 

Related commands