If you have Active Directory and are only concerned about systems in AD, you can get a list of systems, OS type and version, and machine password age by querying AD via LDAP (Net::LDAP). Password age is of course not a nice number to work with, but you can munge the 64-bit integer you get back.
If you have an NT4 domain, you can dump machine names and their password ages as well. That will clear out the dead machines. With an NT4 domain, though, you won't get the OS type. When you are using the netadmin calls, you are relying on the browse list, which is very unreliable. You will get the systems that show up in server manager with an active icon and specific OS name. There may still be machines that are "out there" that you will miss. Adam Greene [EMAIL PROTECTED] -----Original Message----- From: Mathew Shember [mailto:[EMAIL PROTECTED]] Sent: Monday, April 01, 2002 11:29 AM To: Rick Coloccia; [EMAIL PROTECTED] Subject: Re: enumerating machines... Type_ALL is as the name implies. Everything. So If you have win9x, me, They will get counted as well. You could change it to SV_TYPE_NT. This does list 2000 and XP machines. Other things to watch. Samba servers will appear. Network Appliance boxes will appear. Finally, keep in mind. You are scanning the domain list which holds any machine account that is created. If you never remove dead accounts, they are listed as well. At 11:05 AM 4/1/2002 -0500, Rick Coloccia wrote: >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 _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
