Title: Discovering Servers on the Network

Aha!!!  I had tried SV_TYPE_SERVER_NT before, but it seemed to miss a few servers, so I didn’t consider it reliable.

 

Playing with it again, I saw that it was still missing servers from the list... but I just realized that the ones missing are all Domain Controllers. So I’ll just have to do a separate search for DCs and combine the two lists...

 

That should work... Thanks for the help.

 

Ron Rosenkoetter

System Engineer

Server Administration & Management

 

-----Original Message-----
From: Jon Prentice [mailto:[EMAIL PROTECTED]]
Sent
:
Monday, October 21, 2002 5:58 PM
To:
Rosenkoetter, Ronald; [EMAIL PROTECTED]
Subject: Re: Discovering Servers on the Network

 

This works for me:

 

Win32::NetAdmin::GetServers($PDC, $domain, SV_TYPE_SERVER_NT, \@lis

 

-Jon

----- Original Message -----

 

Sent: Monday, October 21, 2002 3:48 PM

Subject: Discovering Servers on the Network

 

I’ve written a script that goes out and tells me how many servers are running a particular service (for licensing purposes). I used to loop through an allservers.txt file, but I’ve gotten tired of updating it as we add new servers (plus it’s possible I could miss a server or two).

Instead, I’ve rewritten my script to use the NetAdmin module to generate a list of servers for me.

Win32::NetAdmin::GetServers('',$Domain,SV_TYPE_SERVER,\@List);

However, this returns all computers that are running the Server service... which includes several thousand XP machines. None of the workstations are running this particular service, so it doesn’t skew my results. The script works, but it takes a good hour or two to run (since I’m hitting every workstation in the domain with a service query, I only run this at night).

Is there anyway to return ONLY a list of actual Servers without hitting each and every machine (to check OS version number for instance). Where does GetServers get its information anyway?? >From a Master Browser??

Any illumination would be most appreciated.

Ron Rosenkoetter

System Engineer

Server Administration & Management

Reply via email to