Skip to main content
Question

Disable the ability to connect to wireless

  • February 15, 2023
  • 7 replies
  • 189 views

MrPeppah
Forum|alt.badge.img+3

Hello,

I am not sure if I am looking for the wrong item or not wording my search correctly to find anything relevant but is there a way to disable or delete the wireless connection or options on our Macs that are hardwired with ethernet. We have students connecting to our wireless that requires authentication which then breaks the connection to the internet. They assume because it's not on wireless it loads slower or doesn't have internet. 

 

The only configuration item I see under the configuration profile is to define a SSID, but I'd like to disable it all together.

7 replies

Forum|alt.badge.img
  • New Contributor
  • February 15, 2023

Hello,

I have a .pkg that disables the wireless connection of any mac as soon as you connect the wired, once you disconnect the wired the wireless connection comes back on. Try it on your test Mac, let me know if that's helpful

 

https://drive.google.com/file/d/1BzlyzZRfWeF-tqwgJiqEWzMwhzws_rL3/view?usp=sharing


AJPinto
Forum|alt.badge.img+26
  • Legendary Contributor
  • February 16, 2023

I had a ticket open with Apple on this very topic last week. MacOS has no built in function to do this. The closest thing apple has built in to macOS is configuring the network service order, which is far from ideal. I have elected to not try to force macOS to do something its not designed to do.

 

I use this script to configure the network service order, we have wifi top but that could be changed.

 

#!/bin/bash ###################### # Script Name: Configuration_Order_Network_Services # Author: # Date: # Purpose: Promote the desired network Service to the 1st in the service order list ###################### ###################### # Global Variables ###################### # echos the current network service order before the script makes changes. grep needs to be cleaned up. Adapter_all=$(networksetup -listnetworkserviceorder | awk '{print $2}') echo " " echo "*********************************************" echo "Being script:" echo "*********************************************" echo " " echo "===============" echo "Current Network Service order:" echo "===============" echo "$Adapter_all" echo "===============" echo " " echo " " new_top_net_service_name='Wi-Fi' # Change this to the name of the new desired top network service. ###################### # Script function ###################### echo " " new_net_service_order="$(networksetup -listallnetworkservices | AWK_ENV_TOP_NET_SERVICE="${new_top_net_service_name}" awk '{ if (NR == 1) { print ENVIRON["AWK_ENV_TOP_NET_SERVICE"] } else if ($0 != ENVIRON["AWK_ENV_TOP_NET_SERVICE"]) { print $0 } }')" echo "===============" echo "New Network Service Order:" echo "===============" echo "$new_net_service_order" echo "===============" IFS=$'\\n' networksetup -ordernetworkservices ${new_net_service_order} unset IFS echo " " echo "*********************************************" echo "End script:" echo "*********************************************" exit 0

 

 

@Daku That is a crafty little package you have there Richard. May want to sign it, and and move it to github or just provide the source files so people dont need to override gatekeeper to see what you are doing. Comes off as very phishy. I would probably remove the email address from the pre-install script and pay load scripts also :).

 

 

 


Forum|alt.badge.img+9
  • Valued Contributor
  • February 16, 2023

You can turn Wi-Fi off with 

sudo networksetup -setairportpower Wi-Fi off

Forum|alt.badge.img+6
  • Contributor
  • January 12, 2024

Hello,

I have a .pkg that disables the wireless connection of any mac as soon as you connect the wired, once you disconnect the wired the wireless connection comes back on. Try it on your test Mac, let me know if that's helpful

 

https://drive.google.com/file/d/1BzlyzZRfWeF-tqwgJiqEWzMwhzws_rL3/view?usp=sharing


If someone wanted to remove this, how would you go about doing that?


Forum|alt.badge.img+7
  • Valued Contributor
  • August 23, 2024

You can turn Wi-Fi off with 

sudo networksetup -setairportpower Wi-Fi off

While this does work, the user can very trivially turn it back on.


Forum|alt.badge.img+9
  • Valued Contributor
  • August 23, 2024

While this does work, the user can very trivially turn it back on.


Please see this related post that may help you.  

https://community.jamf.com/t5/jamf-pro/restrict-ability-to-turn-off-airport/m-p/102907

 


Forum|alt.badge.img+7
  • Valued Contributor
  • August 23, 2024

Please see this related post that may help you.  

https://community.jamf.com/t5/jamf-pro/restrict-ability-to-turn-off-airport/m-p/102907

 


A better option and actually the root cause, was that apparently in sonoma it has been depreciated the old commands to restrict joining and turning on and off wireless to admin only.

This post discusses the work around from apple that they want you to do now, however i cant get it to work currently.

https://community.jamf.com/t5/jamf-pro/wifi-advanced-settings-replacement-command-for-airport/m-p/318805

then wireless off can be restricted to admin to turn it back on.  All those commands in the old post have been depreciated (thanks apple...). i did post that note at the bottom of that page if you did read it.