Listing PC's on an NT Network 
Author Message
 Listing PC's on an NT Network

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.*-*-*.com/
Before you buy.



Sun, 21 Jul 2002 03:00:00 GMT  
 Listing PC's on an NT Network
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


Quote:
> 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.



Mon, 22 Jul 2002 03:00:00 GMT  
 Listing PC's on an NT Network
Thanks, that was a great help.

Found a working example of NetServerEnum on Microsoft Knowledge base
article Q198896 at

http://support.microsoft.com/support/kb/articles/q198/8/96.asp

and also an example of NetUserEnum in Q159498 at

http://support.microsoft.com/support/kb/articles/q159/4/98.asp

which were easy enough to convert to my needs.

Andy



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.

Sent via Deja.com http://www.deja.com/
Before you buy.


Tue, 23 Jul 2002 03:00:00 GMT  
 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.



Tue, 23 Jul 2002 03:00:00 GMT  
 Listing PC's on an NT Network
Its better to use ADSI 2.5 !!!

Chris

Quote:
>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.



Thu, 01 Aug 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How do detect a PC's OS on an NT network

2. Populate list box of networked PC's

3. Listing PC's on different domains from 1 pc

4. Getting a list of Computer's on a network and or a list of Workgroups

5. Communicate between VB programs on different PC on the same network (NT or Novell)

6. Enumerating PCs on an NT network

7. VB4.0 and Windows NT/Networked PCs

8. Listing all network PCs?

9. How to Get List of PC on network?

10. Network question: VB app run off server hangs PC's

11. Q: Getting PC's on a WIN9x Network

12. Network - PC to PC

 

 
Powered by phpBB® Forum Software