Posted on 06-16-2016 06:15 AM
We currently deploy a WPA2 PSK via a configuration profile, we are finding a lot of client Macs are ending up with our client machine wifi at a lower priority than the guest wifi so suddenly nothing works and they get captive portal pop ups.
Can anyone help with a way to:
Help would be greatly appreciated!
Thanks,
Christian
Posted on 06-16-2016 11:20 AM
Hey @cdwyersg
You can use the following commmands to modify priorities of wifi.
#!/bin/sh
currentUser=$(stat -f%Su /dev/console)
currentUserUID=$(dscl . read /Users/$currentUser UniqueID | awk {'print $2'})
wifi=$(/usr/sbin/networksetup -listallhardwareports | grep -A 1 Wi-Fi | grep Device | awk '{print $2}')
SSIDcheck=$(/usr/sbin/networksetup -listpreferredwirelessnetworks $wifi | grep $4 | awk {'print $1'})
echo "Wi-Fi on device port $wifi"
echo "Preferred wireless Network $SSIDcheck"
echo "Policy running for $currentUser"
#############################################################
######## Removes SSID from Preferred Wireless List #########
#############################################################
if [ "$SSIDcheck" = "$4" ];then
echo "Removing $4 from Preferred Networks List"
/usr/sbin/networksetup -removepreferredwirelessnetwork $wifi $4
echo "Adding $4 to number 1 spot for Preferred Networks List"
/usr/sbin/networksetup -addpreferredwirelessnetworkatindex $wifi $4 0 WPA2 $5
else
echo "$4 not in Preferred Networks List, adding to number 1 spot"
/usr/sbin/networksetup -addpreferredwirelessnetworkatindex $wifi $4 0 WPA2 $5
fi
Posted on 09-26-2016 10:13 AM
Pardon my ignorance on this, where do I replace the Wifi SSID we're trying to remove and/or the one we're trying to make top priority?
Posted on 09-26-2016 12:21 PM
@jjones Had a good post here: https://jamfnation.jamfsoftware.com/discussion.html?id=17858
Posted on 01-06-2017 01:46 PM
How about this exact same issue but on iOS???
Posted on 01-06-2017 08:36 PM
@cruess If you need to stop a device from connecting to a network you could push out a profile to the device with the wireless login and password and then remove the profile and that should stop the device from connecting.
Posted on 02-02-2017 07:35 AM
Can´t get any of the scripts to change the order of SSIDs I've found to work on Sierra.
Anybody have a script or trick that works?
Posted on 02-02-2017 12:52 PM
I had good luck with this one at https://gist.github.com/pudquick/fcbdd3924ee230592ab4#file-reorder_wifi_alt-py-L5 after reading about it here
https://www.jamf.com/jamf-nation/discussions/18223/re-order-wifi-preferred-networks