Category filter
Script to hide/disable different System Preferences panes on Mac
System administrators may have requirements to disable the different panes in System Preferences on an employee’s Mac to prevent users from making unwanted changes. With Hexnode’s Execute Custom Script action, admins can remotely hide or disable any System Preferences pane by executing the bash scripts below.
Scripting Language – Bash
File extension – .sh
Disable any System Preferences pane
1 2 |
#!/bin/sh defaults write "/Library/Preferences/com.apple.systempreferences" DisabledPreferencePanes -array "<CFBundleIdentifier>" |
You can disable any System Preferences panes by specifying the correct CFBundleIdentifier in the script above.
Preference Pane | CFBundleIdentifier |
---|---|
Accessibility | com.apple.preference.universalaccess |
Apple ID | com.apple.preferences.AppleIDPrefPane |
Battery | com.apple.preference.battery |
Bluetooth | com.apple.preferences.Bluetooth |
CDs & DVDs | com.apple.preference.digihub.discs |
Content & Privacy | com.apple.preferences.parentalcontrols |
Displays | com.apple.preference.displays |
Extensions | com.apple.preferences.extensions |
Internet Accounts | com.apple.preferences.internetaccounts |
Date & Time | com.apple.preference.datetime |
Desktop & Screen Saver | com.apple.preference.desktopscreeneffect |
Dock & Menu Bar | com.apple.preference.dock |
General | com.apple.preference.general |
Keyboard | com.apple.preference.keyboard |
Language & Region | com.apple.Localization |
Mission Control | com.apple.preference.expose |
Network | com.apple.preference.network |
Notifications | com.apple.preference.notifications |
Passwords | com.apple.Passwords |
Printers & Scanners | com.apple.preference.printfax |
Profiles | com.apple.preferences.configurationprofiles |
Screen Time | com.apple.preference.screentime |
Security | com.apple.preference.security |
Sharing | com.apple.preferences.sharing |
Sidecar | com.apple.preference.sidecar |
Software Update | com.apple.preferences.softwareupdate |
Sound | com.apple.preference.sound |
Siri | com.apple.preference.speech |
Spotlight | com.apple.preference.spotlight |
Startup Disk | com.apple.preference.startupdisk |
Time Machine | com.apple.prefs.backup |
Touch ID | com.apple.preferences.password |
Trackpad | com.apple.preference.trackpad |
Users & Groups | com.apple.preferences.users |
For example, executing the following script will grey out the Bluetooth pane from System Preferences, thus preventing the users from tampering with the Bluetooth settings.
1 2 |
#!/bin/sh defaults write "/Library/Preferences/com.apple.systempreferences" DisabledPreferencePanes -array "com.apple.preferences.Bluetooth" |
To disable multiple System Preferences panes, specify the CFBundleIdentifiers of those preference panes in succession. For example, to disable both Bluetooth and Network from System Preferences:
1 2 |
#!/bin/sh defaults write "/Library/Preferences/com.apple.systempreferences" DisabledPreferencePanes -array "com.apple.preferences.Bluetooth" "com.apple.preferences.network" |
To re-enable the disabled preference panes, execute the script below:
1 2 |
#!/bin/sh defaults delete /Library/Preferences/com.apple.systempreferences DisabledPreferencePanes |
Hide any System Preferences pane
You can also hide the unnecessary preference panes instead of greying them out. This comes handy when you want to clean up the System Preferences window by displaying only the required system settings to the user.
For example, the following script will hide the Bluetooth pane from System Preferences:
1 2 |
#!/bin/sh defaults write "/Library/Preferences/com.apple.systempreferences" HiddenPreferencePanes -array "com.apple.preferences.Bluetooth" |
To unhide the hidden preference panes, execute the script below:
1 2 |
#!/bin/sh defaults delete /Library/Preferences/com.apple.systempreferences HiddenPreferencePanes |
If you are looking to manage preference panes on devices running macOS 13.0 or above, refer to Manage preference panes on Ventura.