Jump to content

Automatically Discover SQL Instances


NateG

Recommended Posts

This can be done with one simple Powershell command:

 

[System.Data.Sql.SqlDataSourceEnumerator]::Instance.GetDataSources()

 

This returns

 

ServerName InstanceName IsClustered Version
---------- ------------ ----------- -------
MY-SQL-SERVER  INSTANCE1       No          11.0.7001.0
MY-SQL-SERVER  INSTANCE2           No          14.0.1000.169
MY-SQL-SERVER  INSTANCE3   No          11.0.7001.0
MY-SQL-SERVER  INSTANCE4         No          11.0.7001.0

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...