# 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](https://www.hexnode.com/mobile-device-management/help/how-to-run-scripts-on-mac-using-hexnode-mdm/) 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.

Script to disable any System Settings pane

\#!/bin/sh defaults write "/Library/Preferences/com.apple.systempreferences" DisabledSystemSettings -array "<CFBundleIdentifier>" 

   1

2

  \#!/bin/sh

defaults write "/Library/Preferences/com.apple.systempreferences" DisabledSystemSettings -array "<CFBundleIdentifier>" 

   

 

  

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

**Preference Pane****CFBundleIdentifier**Accessibilitycom.apple.Accessibility-Settings.extensionAirDrop & Handoffcom.apple.AirDrop-Handoff-Settings.extensionApple IDcom.apple.systempreferences.AppleIDSettingsBatterycom.apple.Battery-Settings.extensionBluetoothcom.apple.BluetoothSettingsControl Centercom.apple.ControlCenter-Settings.extensionDate & Timecom.apple.Date-Time-Settings.extensionDesktop & Dockcom.apple.Desktop-Settings.extensionDisplayscom.apple.Displays-Settings.extensionExtensionscom.apple.ExtensionsPreferencesFocuscom.apple.Focus-Settings.extensionGame Centercom.apple.Game-Center-Settings.extensionInternet Accountscom.apple.Internet-Accounts-Settings.extensionKeyboardcom.apple.Keyboard-Settings.extensionLanguage & Regioncom.apple.Localization-Settings.extensionLock Screencom.apple.Lock-Screen-Settings.extensionLogin Itemscom.apple.LoginItems-Settings.extensionNetworkcom.apple.Network-Settings.extensionNotificationscom.apple.Notifications-Settings.extensionPasswordscom.apple.Passwords-Settings.extensionPrinters & Scannerscom.apple.Print-Scan-Settings.extensionScreen Timecom.apple.Screen-Time-Settings.extensionScreen Savercom.apple.ScreenSaver-Settings.extensionSharingcom.apple.Sharing-Settings.extensionSiri & Spotlightcom.apple.Siri-Settings.extensionSoftware Updatecom.apple.Software-Update-Settings.extensionSoundcom.apple.Sound-Settings.extensionStartup Diskcom.apple.Startup-Disk-Settings.extensionStoragecom.apple.settings.StorageTime Machinecom.apple.Time-Machine-Settings.extensionTouch ID & Passwordcom.apple.Touch-ID-Settings.extensionTrackpadcom.apple.Trackpad-Settings.extensionTransfer or Resetcom.apple.Transfer-Reset-Settings.extensionUsers & Groupscom.apple.Users-Groups-Settings.extensionWallet & Apple Paycom.apple.WalletSettingsExtensionWallpapercom.apple.Wallpaper-Settings.extensionWi-Ficom.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.

Script to disable Bluetooth preference pane from System Settings

\#!/bin/sh defaults write "/Library/Preferences/com.apple.systempreferences" DisabledSystemSettings -array "com.apple.Battery-Settings.extension" 

   1

2

  \#!/bin/sh 

defaults write "/Library/Preferences/com.apple.systempreferences" DisabledSystemSettings -array "com.apple.Battery-Settings.extension" 

   

 

  

[![Disabled Battery preference pane in System Settings](https://cdn.hexnode.com/mobile-device-management/help/wp-content/uploads/2023/03/Disable-Battery-preference-pane-in-System-Settings.png "Disable Battery preference pane in System Settings")](https://cdn.hexnode.com/mobile-device-management/help/wp-content/uploads/2023/03/Disable-Battery-preference-pane-in-System-Settings.png)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:

Script to disable multiple preference panes from System Settings

\#!/bin/sh defaults write "/Library/Preferences/com.apple.systempreferences" DisabledSystemSettings -array "com.apple.BluetoothSettings" "com.apple.Network-Settings.extension"

   1

2

  \#!/bin/sh

defaults write "/Library/Preferences/com.apple.systempreferences" DisabledSystemSettings -array "com.apple.BluetoothSettings" "com.apple.Network-Settings.extension"

   

 

  

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

Script to re-enable the disabled System Settings panes

\#!/bin/sh defaults delete /Library/Preferences/com.apple.systempreferences DisabledSystemSettings 

   1

2

  \#!/bin/sh

defaults delete /Library/Preferences/com.apple.systempreferences DisabledSystemSettings 

   

 

  

Open any System Settings Preference pane
----------------------------------------

Specify the **CFBundleIdentifier** for the preference pane you want to open. Refer to the [table](#CFBundleIdentifier) for the bundle identifiers of different preference panes.

Script to open a System Settings preference pane

\#!/bin/sh open x-apple.systempreferences: <CFbundleIdentifier>

   1

2

  \#!/bin/sh 

open x-apple.systempreferences: <CFbundleIdentifier>

   

 

  

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

Script to open Network preference pane in System Settings

\#!/bin/sh open x-apple.systempreferences: com.apple.preferences.Network-Settings.extension 

   1

2

  \#!/bin/sh

open x-apple.systempreferences: com.apple.preferences.Network-Settings.extension 

   

 

  

If you are looking to manage preference panes on devices running macOS versions below 13.0, refer to [Hide/Disable System Preferences panes](https://www.hexnode.com/mobile-device-management/help/script-to-hide-disable-different-system-preferences-panes-on-mac/).

 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.