Are both nics on the same network as your computer?  I had the same problem,
and that was the only thing I could think of, that GetTransports was
querying each transport from my computer, as opposed to querying the
computer about its transports, so it couldn't see those that were on
separate networks.  Judging from the thread we had last week on the subject,
it looks like your best bet would be to try to get it through WMI.

-----Original Message-----
From: Dans Lists
To: [EMAIL PROTECTED]
Sent: 3/24/02 1:01 PM
Subject: MAC address for Multi-NIC systems

The following snipit of code returns a MAC address this is true but when
I try and get the MAC addresses for systems that have more than one NIC
it only returns one of the MAC addresses.
I can not figure out what all is in the hash returned in $ref as well. I
would like to be able to link the IP address to the MAC address.



Can anybody tell me what is going wrong?

--
Dan


use Win32::NetAdmin;
$ref = {};
$host = $ARGV[0];
Win32::NetAdmin::GetTransports( $host, $ref ) || die "Could not get the
MAC Address!";

foreach $trans(keys %{$ref}){
        $mac = $ref->{$trans}->{'transport_address'};
        print "The hardware address is $mac.\n";
}





_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


--------------------------------------------------------------------------------
This email may contain confidential and privileged 
material for the sole use of the intended recipient. 
If you are not the intended recipient, please contact 
the sender and delete all copies.
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to