Mac OS Big Sur unlock WiFi

supersizeal
Contributor

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 system.preferences.network allow
security authorizationdb write system.services.systemconfiguration.network allow
/usr/libexec/airportd prefs RequireAdminNetworkChange=NO RequireAdminIBSS=NO

1 REPLY 1

Chris_Hafner
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.

#!/bin/bash
# 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
  else
    echo Deleting $SSID
    networksetup -removepreferredwirelessnetwork "$WirelessPort" "$SSID"
  fi
done <<< "$SSIDS"

echo Done!