Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: MAC Address and NIC Device on Network.by vladdrak (Monk) |
on Jun 27, 2001 at 05:27 UTC ( [id://91807]=note: print w/replies, xml ) | Need Help?? |
There is a Resource Kit utility called getmac.exe that can prove useful. You'll want to either compile a list of the machines you want to check, or enumerate an NT domain to check those machines. You could also walk IP addresses if you don't have a network browse list built up.
Anyways, your code might be:
Which would fill $macraw with something like this: ..which you'll clean up with the regex buffer, and then toss it in a hash. The NetBT_El90x just identifies the interface as a 3Com 9xx card. Intels show as E100b, Compaq NetFlex as NetFlx, etc. In Win2k the identifer is actually a GUID that maps back to the driver/service name (joy!). If you have a good idea of what NICs are on your LAN it makes it easier.. you'll probably want to do a dirty scan first on everything, then refine your regex. Good Luck, Vlad
In Section
Seekers of Perl Wisdom
|
|