heh... one way that you can do this. though certainly not the most elegant solution.
You should be able to use a combination of nslookup, ping, and arp to get your answers;
this assumes an NT workstation.
you can use nslookup to get the ip address of the host. Then you can ping the host
putting an entry in the arp table of IP to MACAddress. After that you parse the output
of
arp -a to get the MACAddress. oh what the heck...
----
#it works on my machine! :)
chomp(my $host = shift);
chomp($ip = (grep{s/.*\[([\d\.]+)\].*/$1/} `ping $host`)[0]);
$mac = (grep{s/.+$ip\s+([\d\w-]+)\s.*/$1/}`arp -a`)[0];
print $mac . "\n";
//Matt
-----Original Message-----
From: Stig Sjoberg [mailto:[EMAIL PROTECTED]]
Sent: 13”N3??23“u 19:30
To: [EMAIL PROTECTED]
Subject: Getting computernames and mac addresses
I am trying to get the computername and macaddress for computers on a network.
Do anyone know of module that could help me with this?
Has anyone done somthing similar?
--
If it's worth doing, it's worth hiring someone who know how to do it.
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin