Server Enumeration

  • Thread starter Thread starter JD
  • Start date Start date
J

JD

I'm looking for a way in VB.NET to enumerat the servers on a network. What
I'm looking for is a way to list my SQLServers. I know I can get this if I
call the NETAPI32.dll and use NETServerEnum. I'm looking for a simple way
of doing this in VB.net.
P.S. Some sample code would be great also.
 
Another option is to use SQL-DMO (thru COM-interop). A sample is here:
http://www.developersdex.com/gurus/code/262.asp

I'm looking for a way in VB.NET to enumerat the servers on a network. What
I'm looking for is a way to list my SQLServers. I know I can get this if I
call the NETAPI32.dll and use NETServerEnum. I'm looking for a simple way
of doing this in VB.net.
P.S. Some sample code would be great also.
 
Hi,
What about this? http://www.freevbcode.com/ShowCode.asp?ID=6133

Though this code enumerates all computers in the domain, I think changing
the serverType param to SV_TYPE_SQLSERVER should do what you are looking
for.

HTH


I know I can do this through SQLDMO, I've done this with VB6. I liked the
C# code that used the NetServerEnum, and was hoping for a VB.net example of
using the NetSeverEnum. I suppose if all else fails I can use the SQLDMO,
but I would like to stay away from that.
 
Back
Top