Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to list all the instances and the port they are listening Expand / Collapse
Author
Message
Posted Wednesday, June 11, 2008 10:19 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, March 27, 2014 11:17 PM
Points: 309, Visits: 814
Hi,
We have a requirement. One of our application called Discoverer will scan through the network and list the inventory of SQL Servers. But the problem is it has only option to enter the port for scanning and no option to type instance.

so if we give port as 1433 and scan the network, it misses the servers which don't have
1) Default Instance.
2) Dynamic Port is used.
3) If Instance/Server is listening in different port.

Can someone guide me on this please? Any idea to discover the list of instance and which port they listen when we specify the hostname or just specify the IP Range..?


Regards,
Sakthi
My Blog -> http://www.sqlserverdba.co.cc
Post #515342
Posted Thursday, June 12, 2008 8:50 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, March 27, 2014 11:17 PM
Points: 309, Visits: 814
Or is there any T-SQL Query to find on which port a particular instance is running? I checked in sysrpocessed for one SPID it shows which protocol it has used to connect (TCP/IP or Named..) but it does not show which is the port used...

Regards,
Sakthi
My Blog -> http://www.sqlserverdba.co.cc
Post #515994
Posted Thursday, June 12, 2008 11:32 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 5:38 AM
Points: 6,304, Visits: 13,598
done this already, use xp_regread to read the values from the registry and output

-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs"
Post #516125
Posted Thursday, June 12, 2008 11:34 AM


Keeper of the Duck

Keeper of the Duck

Group: Moderators
Last Login: Monday, August 18, 2014 8:24 AM
Points: 6,634, Visits: 1,871
You want to use SQLPing. Have a domain admin run it.

SQLSecurity.com Free Tools

The registry option only works if you know to connect to the SQL Server. SQLPing will use all known means of identifying SQL Servers, including those which are uninstalled but not running at the time.


K. Brian Kelley, CISA, MCSE, Security+, MVP - SQL Server
Regular Columnist (Security), SQLServerCentral.com
Author of Introduction to SQL Server: Basic Skills for Any SQL Server User
| Professional Development blog | Technical Blog | LinkedIn | Twitter
Post #516128
Posted Friday, June 13, 2008 1:00 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, March 27, 2014 11:17 PM
Points: 309, Visits: 814
Hi Brian Kelley,
Thank you so much for your reply! Just Y'day i got this site through googling... and found that application is really usefull... Anyways thank you so much for your help!!! :)


Regards,
Sakthi
My Blog -> http://www.sqlserverdba.co.cc
Post #516454
Posted Thursday, September 8, 2011 4:30 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 2:22 PM
Points: 71, Visits: 251
Hi
Code to do this in VB. (I think this came from a help file somewhere)

Function FindServers() As DataTable
Dim instance As System.Data.Sql.SqlDataSourceEnumerator = System.Data.Sql.SqlDataSourceEnumerator.Instance
Dim dataTable As System.Data.DataTable = instance.GetDataSources()
Return dataTable

End Function

HTH

pg
Post #1171619
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse