Something like this should do it:
# An array of server names
$servers = 'comp1','comp2','comp3','comp4';
Get-WmiObject -computer $servers -class win32_networkadapter |
Where-Object AdapterType -eq 'Ethernet 802.3' |
Format-Table -auto __SERVER,Caption,ServiceName,AdapterType, MacAddress
with the result being something like (MAC addresses deliberately hidden):
__SERVER Description ServiceName AdapterType MacAddress
-------- ----------- ----------- ----------- ----------
COMP1 Microsoft Virtual Machine Bus Network Adapter netvsc Ethernet 802.3 xx:xx:xx:xx:xx:xx
COMP2 Microsoft Virtual Machine Bus Network Adapter netvsc Ethernet 802.3 xx:xx:xx:xx:xx:xx
COMP3 Realtek PCIe GBE Family Controller RTL8167 Ethernet 802.3 xx:xx:xx:xx:xx:xx
COMP3 Microsoft Virtual Network Switch Adapter VMSMP Ethernet 802.3 xx:xx:xx:xx:xx:xx
COMP4 Realtek PCIe GBE Family Controller RTL8167 Ethernet 802.3 xx:xx:xx:xx:xx:xx
Note:
Some computers can have multiple NICs, and thus multiple MAC addresses.
Not all NICs are physical. (Hyper-V virtualisation above.)
When working from the command line I would use PSH aliases and positional parameters:
gwmi -comp 'comp1','comp2','comp3','comp4' win32_networkadapter | ? AdapterType -eq 'Ethernet 802.3' | ft -auto __SERVER,Caption,ServiceName,AdapterType, MacAddress
Try this PS: http://gallery.technet.microsoft.com/scriptcenter/b780c4e4-e986-40a3-9296-65caadd31211
– Kinnectus – 2014-06-27T06:58:16.717