Posted on 07-04-2017 08:45 AM
We disable (or at least attempt to disable) wireless access on our Mac desktops, and only allow it on our MacBooks.
Can anybody help me with an extension attribute to report whether the relevant wi-fi interface has been enabled or disabled?
Thanks in advance!
Posted on 07-04-2017 10:48 AM
Test in your environment first but something like this should show if the wireless interface is active or inactive.
#!/bin/sh
#get the wireless interface ID
WirelessPort=$(networksetup -listallhardwareports | awk '/Wi-Fi|AirPort/{getline; print $NF}')
#get interface status
WiFiStatus=$(ifconfig "$WirelessPort" | grep 'status:' |cut -d: -f2 | awk '{print $1}')
#return status
echo "<result>$WiFiStatus</result>"
Posted on 07-05-2017 08:18 AM
@ianmb I know you were looking for an EA that would report on status, but I wanted to give you an idea for disabling wireless on your MacPro computers. I use a script to check if there is an Ethernet port active, and if there is it shuts down wireless. This runs using a LaunchDaemon, so the users can try all they like to re-enable WiFi, but if they do not unload the LaunchDaemon it will never work:
I cannot take credit for that script, it was a community effort that was worked out on these discussions:
Disable Airport When Ethernet is Active
This serves two purposes: disables WiFi for those desktop machines that don't need it active, and it ensures your laptop users are not on two networks at once.
Posted on 07-06-2017 08:20 AM
Very nice @stevewood thanks for sharing!