Category filter

Script to manage preference panes on macOS Ventura

System administrators managing a fleet of devices may prefer to disable certain preference panes to ensure devices are configured securely while ensuring no unwanted changes are made. Using Hexnode’s Custom Script feature, admins can deploy scripts to disable System Settings panes across all their devices running macOS Ventura. Additionally, they can also deploy scripts to open preferences panes on the devices to troubleshoot issues and provide support to users.

Scripting Language – Bash

File extension – .sh

Disclaimer:

  • The sample scripts provided below are adapted from third-party open-source sites.
  • The scripts provide below only work on devices running macOS 13.0 or above.

Disable any System Settings pane

You can disable any System Settings panes by specifying the correct CFBundleIdentifier in the script below.

The following table specifies the bundle identifiers of different settings in the System Settings pane.

Preference Pane CFBundleIdentifier
Accessibility com.apple.Accessibility-Settings.extension
AirDrop & Handoff com.apple.AirDrop-Handoff-Settings.extension
Apple ID com.apple.systempreferences.AppleIDSettings
Battery com.apple.Battery-Settings.extension
Bluetooth com.apple.BluetoothSettings
Control Center com.apple.ControlCenter-Settings.extension
Date & Time com.apple.Date-Time-Settings.extension
Desktop & Dock com.apple.Desktop-Settings.extension
Displays com.apple.Displays-Settings.extension
Extensions com.apple.ExtensionsPreferences
Focus com.apple.Focus-Settings.extension
Game Center com.apple.Game-Center-Settings.extension
Internet Accounts com.apple.Internet-Accounts-Settings.extension
Keyboard com.apple.Keyboard-Settings.extension
Language & Region com.apple.Localization-Settings.extension
Lock Screen com.apple.Lock-Screen-Settings.extension
Login Items com.apple.LoginItems-Settings.extension
Network com.apple.Network-Settings.extension
Notifications com.apple.Notifications-Settings.extension
Passwords com.apple.Passwords-Settings.extension
Printers & Scanners com.apple.Print-Scan-Settings.extension
Screen Time com.apple.Screen-Time-Settings.extension
Screen Saver com.apple.ScreenSaver-Settings.extension
Sharing com.apple.Sharing-Settings.extension
Siri & Spotlight com.apple.Siri-Settings.extension
Software Update com.apple.Software-Update-Settings.extension
Sound com.apple.Sound-Settings.extension
Startup Disk com.apple.Startup-Disk-Settings.extension
Storage com.apple.settings.Storage
Time Machine com.apple.Time-Machine-Settings.extension
Touch ID & Password com.apple.Touch-ID-Settings.extension
Trackpad com.apple.Trackpad-Settings.extension
Transfer or Reset com.apple.Transfer-Reset-Settings.extension
Users & Groups com.apple.Users-Groups-Settings.extension
Wallet & Apple Pay com.apple.WalletSettingsExtension
Wallpaper com.apple.Wallpaper-Settings.extension
Wi-Fi com.apple.wifi-settings-extension

For example, executing the following script will prevent the user from accessing the Battery pane in the System Settings app, thus preventing the users from tampering with the Battery settings.

Disabled Battery preference pane in System Settings

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 Settings:

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

Open any System Settings Preference pane

Specify the CFBundleIdentifier for the preference pane you want to open. Refer to the table for the bundle identifiers of different preference panes.

For example, to open the Network preference pane in the System Settings app,

If you are looking to manage preference panes on devices running macOS versions below 13.0, refer to Hide/Disable System Preferences panes.

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