Skip to main content
Question

Return MAC adress of Ethernet adapters

  • October 1, 2019
  • 1 reply
  • 1 view

Forum|alt.badge.img+1

I am using the following to create an EA to return the Mac address of the Ethernet adapters but the field is blank. Any ideas as to what might be the cause?

!/bin/sh

USBMAC=$(networksetup -listallhardwareports | awk '/Hardware Port: USB /{getline; getline; print $NF}')

if [[ "$USBMAC" == "" ]]; then echo "<result>N/A</result>"
else echo "<result>$USBmac</result>"
fi

When I run networksetup -listallhardwareports | awk '/Hardware Port: USB /{getline; getline; print $NF}' directly on the Mac in question it does return the MAC address of the adapter.

1 reply

mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • October 1, 2019

When was the EA created? Just today? If so, have you run an inventory collection on any Mac yet? Because EA values only get populated when inventory is collected on each machine.