in reply to getting server names in the domain and looking up ips
Here's another TIMTOWTDI approach to the original problem..
This uses ADSI via Win32::OLE. No trailing $ for the machine account. Take a look at this and scroll down to "IADsComputer" to see what else is available for machine information. ADSI isn't the answer for everything, but it's handy for the quick things like this.#!/usr/bin/perl -w use strict; use Win32::OLE qw(in); my ($domain, $container, $i); $domain = 'YourDomain'; $container = Win32::OLE->GetObject("WinNT://$domain"); $container->{FILTER} = ["computer"]; foreach my $i (in $container) { print "$i->{NAME}\n"; }
Rich
|
|---|