How to get a list of all the MS SQL Server instances on the local machine?

I am able to see both 2005 and 2008 SQL Server instances on my laptop using Powershell:

Get-Service | Where-Object {$_.Name -like 'MSSQL$*'}

Other possibilities to explore include enumerating through the RegisteredServers namespace.

Leave a Comment