Enumerate SQL Instances on a server -
07-11-2007
, 07:01 AM
Hi,
I'm looking for a way to enumerate SQL Server instances on a given
server. I've seen the GetDataSources() method of the
SqlDataSourceEnumerator class, but this does not cover my needs as it
omits too many instances (reports less than half of the instances) -
probably due to network segments.
So what I would like is to connect to a specific server and check which
instances are running, then connect to the next server etc as I do have
a complete list of all servers and this will run as part of a nightly
inventory process.
Any tips? Is parsing the registry the best method? Is there a way to
"talk" to the SQL browser running on UDP/1434 on each server? Or should
I look into calling the SQLBrowserConnect ODBC call?
I'm programming in C# on .NET 2.0, but any tips are welcome.
Regards,
Arild |