RayRay459 has asked for the wisdom of the Perl Monks concerning the following question:
# Ray Espinoza # GetDomainServers.pl # Get servers in domain and matches # sends the output to a text file. ################################################################ #!D:\Perl\bin -w use strict; use Win32::NetAdmin; open (OUT,">list.txt") || die "Cannot create machine list. :$!"; # This will get the list of machine names from the PDC my @users; Win32::NetAdmin::GetUsers("\\\\PDC",'',\@users); my @computers = grep { /\$$/ } @users; @computers = join("\n",@computers); foreach my $box (@computers) { chop $box; # removes terminal char, must be $ from grep print OUT "$box\n"; # print each $box on a newline } close OUT;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: same question...different results..:o)
by rchiav (Deacon) on Aug 08, 2001 at 03:09 UTC | |
by RayRay459 (Pilgrim) on Aug 08, 2001 at 03:15 UTC | |
|
Re: same question...different results..:o)
by VSarkiss (Monsignor) on Aug 08, 2001 at 03:13 UTC |