AlanTsai
12/19/2016 - 7:05 AM

Get installed Sql Server Instance - 取得安裝在機器上面的 sql server #powershell

Get installed Sql Server Instance - 取得安裝在機器上面的 sql server #powershell

Get-ItemProperty 'HKLM:\Software\Microsoft\Microsoft SQL Server\Instance Names\SQL'

Location of installed sql server Instance

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL

EDIT:

If you are looking for 32 bit instances on a 64 bit OS, you will need to look here:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server\Instance Names\SQL

source: https://blogs.msdn.microsoft.com/askjay/2011/10/11/how-can-i-get-a-list-of-installed-sql-server-instances/