Mac OS Big Sur unlock WiFi

New Contributor III

How can I allow my Teacher's ( Standard User) to delete their own preferred network AP's without the computer asking for Admin Credentials?

I have the padlock unlocked but when making a change it still asks for admin rights.

I have used these commands and it didn't work,
security authorizationdb write allow
security authorizationdb write allow
/usr/libexec/airportd prefs RequireAdminNetworkChange=NO RequireAdminIBSS=NO


Valued Contributor II

I use a script borrowed from JAMFNation for this in a Self-Service policy. Even for admin users, it's simple. I have it set up to leave the currently connected SSID as well as any other that's important.

# in this script, COMPANY WiFi can be replaced with whatever your particular SSID is named.

WirelessPort=$(networksetup -listallhardwareports | awk '/Wi-Fi|AirPort/{getline; print $NF}')
SSIDS=$(networksetup -listpreferredwirelessnetworks "$WirelessPort" | sed '1d')
CURRENTSSID=$(networksetup -getairportnetwork "$WirelessPort" | sed 's/^Current Wi-Fi Network: //')

while read -r SSID; do
  if [ "$SSID" == "IMPORTANT-SSID" ]; then
    echo Skipping $SSID
  elif [ "$SSID" == "$CURRENTSSID" ]; then
    echo Skipping your current network $SSID
    echo Deleting $SSID
    networksetup -removepreferredwirelessnetwork "$WirelessPort" "$SSID"
done <<< "$SSIDS"

echo Done!