Jump to content

Automatically Discover SQL Instances


NateG
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...