Posted on 03-08-2024 09:48 AM
I've messing around with the below script I found, so we can allow some users to forget ssid's. When I forget the wifi, I still get the admin prompt, but if I hit cancel on the prompt, it does forget the ssid. Just trying to figure out how to get the prompt to not show on Sonoma.
#!/bin/bash
# Get a list of preferred Wi-Fi networks
wifiList=$(networksetup -listpreferredwirelessnetworks en0 | sed 's/^\*//')
# Present a dialog box for selecting a Wi-Fi network to forget
selectedWifi=$(osascript -e 'choose from list {'"${wifiList}"'} with prompt "Select the Wi-Fi network to forget:"' | tr ',' '\n' | sed -n 2p)
if [ -n "$selectedWifi" ]; then
# Forget the selected Wi-Fi network without requiring admin privileges
sudo -u $USER networksetup -removepreferredwirelessnetwork en0 "$selectedWifi"
echo "Wi-Fi network '$selectedWifi' has been forgotten."
fi
echo "Please select the Wi-Fi network you want to forget."
Solved! Go to Solution.
Posted on 03-08-2024 10:18 AM
typically i use the following commands to allow standard users to modify wifi and network settings:
/usr/bin/security authorizationdb write system.preferences.network allow
/usr/bin/security authorizationdb write system.services.systemconfiguration.network allow
/usr/bin/security authorizationdb write com.apple-wifi allow
Posted on 03-08-2024 10:18 AM
typically i use the following commands to allow standard users to modify wifi and network settings:
/usr/bin/security authorizationdb write system.preferences.network allow
/usr/bin/security authorizationdb write system.services.systemconfiguration.network allow
/usr/bin/security authorizationdb write com.apple-wifi allow
Posted on 08-29-2024 07:13 AM
This does not work for me on Sonoma, any idea why?
Posted on 08-29-2024 07:17 AM
For us one of the reasons it wasn't working is because we use CyberArk EPM and for some reason it was blocking it on the version, we were using 22.12. Since we updated to 24.4, we're able to forget old SSID's.