Actually, if your browsers are set up correctly (no dual-homed machines being browse masters) they *should* auto-updated to/from one of the DCs, even if they are on physically separate network segments.
-----Original Message----- From: Tim Johnson [mailto:[EMAIL PROTECTED] Sent: Monday, October 20, 2003 3:40 PM To: Messenger, Mark; Tim Johnson; Stefan Olsson; [EMAIL PROTECTED] Subject: RE: foreach my $computer ($domain) I normally do ping machines before I try to do anything else because otherwise you can be faced with intolerably long timeouts, but what I was trying to convey is that using a function like Win32::Lanman::GetUsers or Win32::AdminMisc::GetMachines returns all machines that have accounts on the domain vs. all machines that are currently connected to the network within the same group, which is what you get with net view (I'm simplifying it a little, but that's basically it). Many times it won't make a difference, but if you are trying to get some data and it is crucial that you get the status of as many machines as possible AND that you know how complete your data is, then it does make a difference. -----Original Message----- From: Messenger, Mark [mailto:[EMAIL PROTECTED] Sent: Monday, October 20, 2003 11:20 AM To: Tim Johnson; Stefan Olsson; [EMAIL PROTECTED] Subject: RE: foreach my $computer ($domain) Actually, a little Net::Ping action should take care of all of those things :) -----Original Message----- From: Tim Johnson [mailto:[EMAIL PROTECTED] Sent: Monday, October 20, 2003 10:43 AM To: Messenger, Mark; Stefan Olsson; [EMAIL PROTECTED] Subject: RE: foreach my $computer ($domain) There is an important distinction between getting all computers in the domain and getting all computers on the browse list. It all depends on the purpose of your script. If you don't care about which computers you missed, then getting a list using net view or NetAdmin is fine. But let's say you want to get the age of each computer's secure password so that you can find machines that no longer exist on the domain. Then you wouldn't want to. Or in the case of the OP, he probably wants to know which computers he missed so that he can come back for them later (laptops, people on vacation, etc). What I usually do is put all of the computers that didn't respond into text file so I don't repeat the ones I got, and then I can keep narrowing it down on subsequent passes. -----Original Message----- From: Messenger, Mark [mailto:[EMAIL PROTECTED] Sent: Monday, October 20, 2003 9:18 AM To: Stefan Olsson; [EMAIL PROTECTED] Subject: RE: foreach my $computer ($domain) You can use Win32::LanMan, Win32::NetAdmin, or just plaing old `net view`: @machs=`net view`; foreach $_ (@machs) { ($computername,$comment)=split(/\s/): #$computername= '\\SERVERNAME'; } HTH :) -----Original Message----- From: Stefan Olsson [mailto:[EMAIL PROTECTED] Sent: Monday, October 20, 2003 9:36 AM To: [EMAIL PROTECTED] Subject: foreach my $computer ($domain) Hello, I would like to do an inventory on all pc's in the domain (Active Directory). It is just that I have problem to actually retrieve the data when doing this: my $Data = Win32::OLE->GetObject("WinNT://$LocalDomain") or die "Unable connect to domain"; -When using Data::Dumper on $Data this is the result: $VAR1 = bless( {}, 'Win32::OLE' ); -All I want to do is to enumerate the computers in the domain and save them in @computers to then do an inventory on each of them. Can someone help me on this? ---<script begins here>-------------- #!/usr/bin/env perl use strict; use warnings; use Win32::OLE; use Data::Dumper; my $LocalDomain="NTDOMAIN"; my $Data= Win32::OLE->GetObject("WinNT://$LocalDomain") or die "Unable connect to domain"; print Dumper($Data); ---<script begins here>-------------- above results in a single line: $VAR1 = bless( {}, 'Win32::OLE' ); _________________________________________________________________ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus _______________________________________________ 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
