Category filter
Script to hide Profiles pane from System Preferences on macOS devices
Being the IT administrator of a school or business organization, you might have requirements where you need to hide or disable the Profiles pane from System Preferences on your Mac endpoints. This way, you can prevent users from tampering with the installed profiles and avoid making any configuration errors on the devices. With Hexnode’s Execute Custom Script action, you can remotely hide/disable the Profiles pane on your devices using this bash script.
Scripting Language – Bash
File extension – .sh
Script to Disable Profiles pane
1 2 |
#!/bin/sh defaults write "/Library/Preferences/com.apple.systempreferences" DisabledPreferencePanes -array "com.apple.preferences.configurationprofiles" |
On running the above script, the Profiles pane will be greyed out from the System Preferences tab on the device.
Script to Hide Profiles pane
By changing the key from DisabledPreferencePanes to HiddenPreferencePanes, you can configure the Profiles pane to be hidden rather than greyed out.
1 2 |
#!/bin/sh defaults write "/Library/Preferences/com.apple.systempreferences" HiddenPreferencePanes -array "com.apple.preferences.configurationprofiles" |
You can disable/hide any System Preferences pane using this script. All you have to do is identify the correct Bundle identifier for the required pane, and include it in the script by following the correct syntax.
For example, the following script will disable Bluetooth in addition to the Profiles pane:
1 2 |
#!/bin/sh defaults write "/Library/Preferences/com.apple.systempreferences" DisabledPreferencePanes -array "com.apple.preferences.configurationprofiles" "com.apple.preferences.Bluetooth" |