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

Disclaimer:

  • The sample scripts provided below are adapted from third-party open-source sites.
  • The scripts provided below works only on devices running macOS versions below 13.0.

Disable any System Preferences pane

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.

Disabled Bluetooth preference pane

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:

To re-enable the disabled preference panes, execute the script below:

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:

Hidden Bluetooth preference pane

To unhide the hidden preference panes, execute the script below:

If you are looking to manage preference panes on devices running macOS 13.0 or above, refer to Manage preference panes on Ventura.

Notes:

  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.
  • Sample Script Repository