I don't have much experience with W2K, but on NT I found that it usually
returns only the machines that are powered on and connected to the network
at the time you run the script.

So you might get different number of machines depending on the time of day
you run it.

Cheers,

/LG



                                                                                       
                            
                                                                                       
                            
                                                                 Para:   
[EMAIL PROTECTED] 
               Rick Coloccia <[EMAIL PROTECTED]>              cc:                   
                            
               Enviado Por:                                      Assunto:     
enumerating machines...              
               [EMAIL PROTECTED]                              
                            
               e.com                                                                   
                            
                                                                                       
                            
                                                                                       
                            
               01/04/2002 11:05 EST                                                    
                            
                                                                                       
                            
                                                                                       
                            



Everyone,

Maybe someone has some experience doing what I'm trying to do:

I am in a mixed windows 2000 domain (not native mode, there are still nt4
boxes, etc, around.)

When I go into the Active Directory Users and Computers application and
view all the computers I have, I see that there are 727 objects (NT4, W2k,
WinXP machines).


I want to use perl to create that list somehow. When I run the code I have
below, I get 280 computers.  I suspect that the filter I'm using
(SV_TYPE_ALL) is at fault, but I can't seem to find anything more
appropriate.  Does anyone have any suggestions?

Thanks!

-Rick



use Win32::NetAdmin;

$count=0;

Win32::NetAdmin::GetServers(undef, "GENESEO", SV_TYPE_ALL,
\%all_server_ref);

foreach $server (keys(%all_server_ref)) {print "$server\n"; $count++; }

print $count;


-------------
Rick Coloccia
Network Analyst
SUNY Geneseo
124B2 South Hall
Geneseo, NY 14454
Voice: (585) 245-5577
Fax: (585) 245-5579

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs




_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to