Server Enumeration

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.
 
S

Shiva

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.
 
S

Shiva

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top