Posted on 01-20-2014 06:54 AM
For JSS 8.x-- Has anyone already developed EA's to collect ethernet adapter MAC addresses?
I'm not convinced all my client and support staff are giving me this information so that I can add them to the removable address list.
Solved! Go to Solution.
Posted on 01-20-2014 07:35 AM
Yeah, we have ones or both. As with anything, there are probably a half dozen ways this can be done, and there may be better ways, but these work for us
USB Ethernet
#!/bin/sh
USBMAC=$(networksetup -listallhardwareports | awk '/Hardware Port: USB Ethernet/{getline; getline; print $NF}')
if [[ "$USBMAC" == "" ]]; then
echo "<result>N/A</result>"
else
echo "<result>$USBmac</result>"
fi
Thunderbolt Ethernet
#!/bin/sh
TBMAC=$(networksetup -listallhardwareports | awk '/Hardware Port: Thunderbolt Ethernet/{getline; getline; print $NF}')
if [[ "$TBMAC" == "" ][; then
echo "<result>N/A</result>"
else
echo "<result>$TBMAC</result>"
fi
Posted on 01-20-2014 07:35 AM
Yeah, we have ones or both. As with anything, there are probably a half dozen ways this can be done, and there may be better ways, but these work for us
USB Ethernet
#!/bin/sh
USBMAC=$(networksetup -listallhardwareports | awk '/Hardware Port: USB Ethernet/{getline; getline; print $NF}')
if [[ "$USBMAC" == "" ]]; then
echo "<result>N/A</result>"
else
echo "<result>$USBmac</result>"
fi
Thunderbolt Ethernet
#!/bin/sh
TBMAC=$(networksetup -listallhardwareports | awk '/Hardware Port: Thunderbolt Ethernet/{getline; getline; print $NF}')
if [[ "$TBMAC" == "" ][; then
echo "<result>N/A</result>"
else
echo "<result>$TBMAC</result>"
fi
Posted on 07-01-2020 07:48 PM
Any ideas how to do this on iPad with Belkin LAN + PoE adapter?