
Listing PC's on an NT Network
Adrian,
If the machine is configured NOT to broadcast itself in the browse list,
then NetServerEnum would not find those systems. The last assignment I was
on disabled file/print sharing on some of the NT workstations. Even worse,
sometimes Servers would not be displayed properly in the Browse(Network
Neighborhood) list ('quirky' situation).
I had a similar problem. In the case listed above, they gave me the IP
segment #'s for the entire network. It took a longer period of time but, I
used NetServerEnum on each domain and dumped the names to a database table.
After that was complete, I PINGED each system from the database table and
retrieved the corresponding IP Address.
Using the IP Segment #'s, I PINGED all remaining IP addresses. If I
received a reply, my program would do a reverse-lookup (IP-to-ComputerName)
and would place that information in the database table.
Again - this may not be necessary in your situation but, you may want to
keep it in mind. Especially if you have a 'quirky' environment like my last
assignment.
--
Shane C. Hage
MCSE+I, MCT, CNA
Quote:
> You need to use 2 API calls - the first is NetServerEnum to retrieve a
list
> of all the PC's currently turned on in the specified domain (just pulled
> from the browse list) and then NetUserEnum against all of the PC's -
> Several points to bare in mind are:
> 1. I think you may need to be in the local administrators group of the
PC's
> in question.
> 2. It's a good idea to ping them before trying to get the usersnames from
> them
> 3. It will show the last logged on users not just ones currently logged
> on... so if the policy is not set to clear 'last logged on user' info the
> responses may be no use and if the PC's are hardly ever rebooted it may
not
> help much!
> Other than that it should take about 5 minutes to detail around 800 PC's.
> The good news is I'm hoping to post some code/program/both as freeware or
> shareware doing this and a lot more on the internet in the next few months
> when the software has passed some more beta testing and improvements.
> Cheers
> Adrian
> > Hi all
> > How do I get a list of logged on PC's on an NT4 network?
> > Thanks in advance.
> > Andy Duckworth
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.