Skip to main content
Solved

Admin prompt when forgetting wifi


SMR1
Forum|alt.badge.img+13
  • Valued Contributor
  • 218 replies

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

  

Best answer by mschlosser

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
View original
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+11
  • Contributor
  • 126 replies
  • Answer
  • March 8, 2024

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

Forum|alt.badge.img+4
  • Contributor
  • 12 replies
  • August 29, 2024
mschlosser wrote:

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

This does not work for me on Sonoma, any idea why?


SMR1
Forum|alt.badge.img+13
  • Author
  • Valued Contributor
  • 218 replies
  • August 29, 2024

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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings