Skip to main content
Solved

Changing preferred Wifi networks without admin rights?

  • Nov 13, 2018 10:53 AM UTC
  • 18 replies
  • 1142 views

Forum|alt.badge.img+3

We’ve recently removed admin rights on Macs for all of our users. Does anyone know of a way to enable users to always be able to administer preferred/saved Wifi networks which are saved on their machines without having to grant them temporary admin rights?

Best answer by dsavageED

Maybe try:

#!/bin/bash

# Workaround as shown in https://www.jamf.com/jamf-nation/discussions/19050/add-wifi-networks-without-admin-privileges
# Allows non-admin users to add printers and manage their WiFi configuration.

#For WiFi

/usr/bin/security authorizationdb write system.preferences.network allow
/usr/bin/security authorizationdb write system.services.systemconfiguration.network allow

#For printing

/usr/bin/security authorizationdb write system.preferences.printing allow
/usr/bin/security authorizationdb write system.print.operator allow
/usr/sbin/dseditgroup -o edit -n /Local/Default -a everyone -t group lpadmin
/usr/sbin/dseditgroup -o edit -n /Local/Default -a everyone -t group _lpadmin

exit 0;
View original

18 replies

mark_mahabir
Forum|alt.badge.img+17
  • Jamf Heroes
  • Nov 13, 2018 11:35 AM UTC

We use a script mentioned in this thread to allow users to set preferred networks in Self Service.

Does that help at all?


dsavageED
Forum|alt.badge.img+8
  • New Contributor
  • Answer
  • Nov 13, 2018 11:41 AM UTC

Maybe try:

#!/bin/bash

# Workaround as shown in https://www.jamf.com/jamf-nation/discussions/19050/add-wifi-networks-without-admin-privileges
# Allows non-admin users to add printers and manage their WiFi configuration.

#For WiFi

/usr/bin/security authorizationdb write system.preferences.network allow
/usr/bin/security authorizationdb write system.services.systemconfiguration.network allow

#For printing

/usr/bin/security authorizationdb write system.preferences.printing allow
/usr/bin/security authorizationdb write system.print.operator allow
/usr/sbin/dseditgroup -o edit -n /Local/Default -a everyone -t group lpadmin
/usr/sbin/dseditgroup -o edit -n /Local/Default -a everyone -t group _lpadmin

exit 0;

Forum|alt.badge.img+3
  • Author
  • New Contributor
  • Nov 14, 2018 9:32 AM UTC

@dsavageED - That worked perfectly, thank you!


Forum|alt.badge.img+7

Maybe try:

#!/bin/bash

# Workaround as shown in https://www.jamf.com/jamf-nation/discussions/19050/add-wifi-networks-without-admin-privileges
# Allows non-admin users to add printers and manage their WiFi configuration.

#For WiFi

/usr/bin/security authorizationdb write system.preferences.network allow
/usr/bin/security authorizationdb write system.services.systemconfiguration.network allow

#For printing

/usr/bin/security authorizationdb write system.preferences.printing allow
/usr/bin/security authorizationdb write system.print.operator allow
/usr/sbin/dseditgroup -o edit -n /Local/Default -a everyone -t group lpadmin
/usr/sbin/dseditgroup -o edit -n /Local/Default -a everyone -t group _lpadmin

exit 0;

Is this still valid for macOS 12.3.1? I just tried it and while networking is now indeed unlocked it will ask me for admin logon when I hit OK. The changes wont stick without it.


Forum|alt.badge.img+8

Is this still valid for macOS 12.3.1? I just tried it and while networking is now indeed unlocked it will ask me for admin logon when I hit OK. The changes wont stick without it.


I'm seeing the same issue; the networking pane is unlocked, but when I choose a Wi-Fi networks and hit the minus "-", it asks me for admin login.

It does work, it just needs the

/usr/bin/security authorizationdb write com.apple.wifi allow

line in it too.


Forum|alt.badge.img+3
  • New Contributor
  • Dec 1, 2022 3:41 PM UTC

May be a dumb question, but I assume this is just a "run once per machine" deployment, or do we need to stick it in self service to be run on demand


Forum|alt.badge.img+8

I run it "once per machine".


Forum|alt.badge.img+7

I'm seeing the same issue; the networking pane is unlocked, but when I choose a Wi-Fi networks and hit the minus "-", it asks me for admin login.

It does work, it just needs the

/usr/bin/security authorizationdb write com.apple.wifi allow

line in it too.


Did that, policy ran ok with below results but making changes to WiFi STILL asks me for admin credentials.

[STEP 1 of 4]
Executing Policy System Preferences - Print and WiFi without admin
[STEP 2 of 4]
Running script System Preferences - Print and WiFi without admin...
Script exit code: 0
Script result: YES (0)
YES (0) YES (0) YES (0) YES (0)
[STEP 3 of 4]
[STEP 4 of 4]

Forum|alt.badge.img+8

Did that, policy ran ok with below results but making changes to WiFi STILL asks me for admin credentials.

[STEP 1 of 4]
Executing Policy System Preferences - Print and WiFi without admin
[STEP 2 of 4]
Running script System Preferences - Print and WiFi without admin...
Script exit code: 0
Script result: YES (0)
YES (0) YES (0) YES (0) YES (0)
[STEP 3 of 4]
[STEP 4 of 4]

Well, well, the test machine I have is Ventura 13.01, and indeed, it is now asking for admin credentials. Looks like we'll need another solution.


Forum|alt.badge.img+7

Well, well, the test machine I have is Ventura 13.01, and indeed, it is now asking for admin credentials. Looks like we'll need another solution.


This is how Apple keeps us entertained.


Forum|alt.badge.img
  • New Contributor
  • Dec 14, 2022 11:21 PM UTC

Well, well, the test machine I have is Ventura 13.01, and indeed, it is now asking for admin credentials. Looks like we'll need another solution.


Not sure if this is relevant but I added /usr/libexec/airportd prefs RequireAdminNetworkChange=NO RequireAdminIBSS=NO before testing

While testing on Ventura, I found that I'm prompted for the admin password, but I click Cancel and the removal still works. Curious if you get the same result.


Forum|alt.badge.img+3
  • New Contributor
  • Feb 8, 2023 10:29 PM UTC

does anyone know how to reverse the script so it's back to being admin locked? 


Forum|alt.badge.img+3

does anyone know how to reverse the script so it's back to being admin locked? 


I believe you will have to delete the preferences you made changes to in order to get it back the way it was.


Forum|alt.badge.img+3

Anyone has found or written a script to allow user changes for WiFi settings for Ventura?


Forum|alt.badge.img+7

Anyone has found or written a script to allow user changes for WiFi settings for Ventura?


I'm struggling to allow this on MacOS Ventura as well.
Anyone found a solution?


Forum|alt.badge.img
  • New Contributor
  • Oct 11, 2023 1:24 PM UTC

I'm struggling to allow this on MacOS Ventura as well.
Anyone found a solution?


i have rearranged the code to only allow the 'Activation W-Lan Management Settings'

Maybe try this:

#!/bin/bash

# Workaround as shown in https://www.jamf.com/jamf-nation/discussions/19050/add-wifi-networks-without-admin-privileges
# Allows non-admin users to manage their WiFi configuration.

#For WiFi

/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

/usr/sbin/dseditgroup -o edit -n /Local/Default -a everyone -t group lpadmin
/usr/sbin/dseditgroup -o edit -n /Local/Default -a everyone -t group _lpadmin

exit 0;

 


9GqPZD
Forum|alt.badge.img+1
  • New Contributor
  • Oct 27, 2025 12:25 PM UTC

We’ve recently removed admin rights on Macs for all of our users. Does anyone know of a way to enable users to always be able to administer preferred/saved Wifi networks which are saved on their machines without having to grant them temporary admin rights?

Has a better solution been found for this or is the script still the best way?


Josh-Q
Forum|alt.badge.img+6
  • Jamf Heroes
  • Oct 27, 2025 3:09 PM UTC

​@9GqPZD I believe this is still the way. Seems to still be working on our macOS 26 deployments.