Posted on 06-09-2015 07:26 PM
If you block users from being local admin this script will enable it for non local admins.
#!/bin/sh
# Get "Wi-Fi" or "Airport" based on your OS
wservice=`/usr/sbin/networksetup -listallnetworkservices | grep -Ei '(Wi-Fi|AirPort)'`
# Get port
whwport=`/usr/sbin/networksetup -listallhardwareports | awk "/$wservice/,/Ethernet Address/" | awk 'NR==2' | cut -d " " -f 2`
# Set preferences
/usr/libexec/airportd "$whwport" prefs DisconnectOnLogout=Yes JoinMode=Automatic JoinModeFallback=DoNothing RememberRecentNetworks=No RequireAdminIBSS=No RequireAdminNetworkChange=No RequireAdminPowerToggle=No
exit 0
Posted on 06-10-2015 03:24 AM
Thanks Ken. This helps with another project I'm working on at the moment.