Tutorial

Novas atualizações e melhorias para a Roundfleet.

Aviso importante

Os exemplos de código e scripts fornecidos nestes tutoriais são apenas para fins educacionais. A Roundfleet não é responsável por quaisquer problemas, danos ou vulnerabilidades de segurança que possam surgir do uso, modificação ou implementação destes exemplos. Sempre revise e teste o código em um ambiente seguro antes de usá-lo em sistemas de produção.

Manage System Settings Panels on macOS

Control which System Settings panels users can access on macOS Ventura and later versions. This tutorial shows how to disable or hide specific preference panes to maintain security and prevent unwanted configuration changes across your Roundfleet.

Understanding System Settings vs System Preferences

macOS Ventura (13.0+) replaced "System Preferences" with "System Settings". The management approach differs between versions:

  • macOS 13.0+: Use DisabledSystemSettings and bundle identifiers ending in .extension
  • macOS 12.x and earlier: Use DisabledPreferencePanes with different bundle identifiers

Disable System Settings Panels

Basic Disable Script

#!/bin/bash

# Disable specific System Settings panel
defaults write "/Library/Preferences/com.apple.systempreferences" DisabledSystemSettings -array "com.apple.Battery-Settings.extension"

echo "System Settings panel disabled successfully"

Disable Multiple Panels

#!/bin/bash

# Disable multiple System Settings panels
defaults write "/Library/Preferences/com.apple.systempreferences" DisabledSystemSettings -array \
    "com.apple.BluetoothSettings" \
    "com.apple.Network-Settings.extension" \
    "com.apple.Battery-Settings.extension"

echo "Multiple System Settings panels disabled"

System Settings Bundle Identifiers

Panel NameBundle Identifier
Accessibilitycom.apple.Accessibility-Settings.extension
AirDrop & Handoffcom.apple.AirDrop-Handoff-Settings.extension
Apple IDcom.apple.systempreferences.AppleIDSettings
Batterycom.apple.Battery-Settings.extension
Bluetoothcom.apple.BluetoothSettings
Control Centercom.apple.ControlCenter-Settings.extension
Date & Timecom.apple.Date-Time-Settings.extension
Desktop & Dockcom.apple.Desktop-Settings.extension
Displayscom.apple.Displays-Settings.extension
Extensionscom.apple.ExtensionsPreferences
Focuscom.apple.Focus-Settings.extension
Game Centercom.apple.Game-Center-Settings.extension
Internet Accountscom.apple.Internet-Accounts-Settings.extension
Keyboardcom.apple.Keyboard-Settings.extension
Language & Regioncom.apple.Localization-Settings.extension
Lock Screencom.apple.Lock-Screen-Settings.extension
Login Itemscom.apple.LoginItems-Settings.extension
Networkcom.apple.Network-Settings.extension
Notificationscom.apple.Notifications-Settings.extension
Passwordscom.apple.Passwords-Settings.extension
Printers & Scannerscom.apple.Print-Scan-Settings.extension
Screen Timecom.apple.Screen-Time-Settings.extension
Screen Savercom.apple.ScreenSaver-Settings.extension
Sharingcom.apple.Sharing-Settings.extension
Siri & Spotlightcom.apple.Siri-Settings.extension
Software Updatecom.apple.Software-Update-Settings.extension
Soundcom.apple.Sound-Settings.extension
Startup Diskcom.apple.Startup-Disk-Settings.extension
Storagecom.apple.settings.Storage
Time Machinecom.apple.Time-Machine-Settings.extension
Touch ID & Passwordcom.apple.Touch-ID-Settings.extension
Trackpadcom.apple.Trackpad-Settings.extension
Transfer or Resetcom.apple.Transfer-Reset-Settings.extension
Users & Groupscom.apple.Users-Groups-Settings.extension
Wallet & Apple Paycom.apple.WalletSettingsExtension
Wallpapercom.apple.Wallpaper-Settings.extension
Wi-Ficom.apple.wifi-settings-extension

Open System Settings Panels Remotely

Open Specific Panel

#!/bin/bash

# Open Network settings panel
open "x-apple.systempreferences:com.apple.Network-Settings.extension"

echo "Network settings panel opened"

Conditional Panel Opening

#!/bin/bash

PANEL_ID="com.apple.Battery-Settings.extension"

# Check if panel is not disabled before opening
if ! defaults read "/Library/Preferences/com.apple.systempreferences" DisabledSystemSettings 2>/dev/null | grep -q "$PANEL_ID"; then
    open "x-apple.systempreferences:$PANEL_ID"
    echo "Battery settings panel opened"
else
    echo "Battery settings panel is disabled"
fi

Re-enable Disabled Panels

Re-enable All Panels

#!/bin/bash

# Remove all disabled System Settings restrictions
defaults delete "/Library/Preferences/com.apple.systempreferences" DisabledSystemSettings

echo "All System Settings panels re-enabled"

Re-enable Specific Panels

#!/bin/bash

# Get current disabled panels
CURRENT_DISABLED=$(defaults read "/Library/Preferences/com.apple.systempreferences" DisabledSystemSettings 2>/dev/null)

# Remove specific panel from disabled list (requires custom logic)
# This example shows the concept - implement based on your needs
defaults write "/Library/Preferences/com.apple.systempreferences" DisabledSystemSettings -array \
    "com.apple.BluetoothSettings"
    # Add other panels you want to keep disabled

echo "Specific System Settings panels re-enabled"

Enterprise Management Script

#!/bin/bash

# Enterprise System Settings Management
# Restricts access to sensitive configuration panels

RESTRICTED_PANELS=(
    "com.apple.Network-Settings.extension"
    "com.apple.BluetoothSettings"
    "com.apple.Security-Privacy-Settings.extension"
    "com.apple.Software-Update-Settings.extension"
    "com.apple.Users-Groups-Settings.extension"
)

# Apply restrictions
defaults write "/Library/Preferences/com.apple.systempreferences" DisabledSystemSettings -array "${RESTRICTED_PANELS[@]}"

# Verify restrictions
echo "Disabled System Settings panels:"
defaults read "/Library/Preferences/com.apple.systempreferences" DisabledSystemSettings 2>/dev/null || echo "No panels currently disabled"

# Log the action
logger "Roundfleet: System Settings panels restricted on $(date)"

Troubleshooting

Check Current Restrictions

# View currently disabled panels
defaults read "/Library/Preferences/com.apple.systempreferences" DisabledSystemSettings

# Check if specific panel is disabled
if defaults read "/Library/Preferences/com.apple.systempreferences" DisabledSystemSettings 2>/dev/null | grep -q "com.apple.Battery-Settings.extension"; then
    echo "Battery panel is disabled"
else
    echo "Battery panel is accessible"
fi

Clear All Restrictions

# Emergency reset - re-enable all panels
sudo defaults delete "/Library/Preferences/com.apple.systempreferences" DisabledSystemSettings
sudo killall cfprefsd

Common Use Cases

ScenarioRecommended Panels to Disable
Shared WorkstationsUsers & Groups, Software Update, Network
BYOD DevicesApple ID, Transfer or Reset, Users & Groups
Kiosk ModeAll except essential panels for operation
Educational LabsNetwork, Software Update, Touch ID & Password
Corporate SecuritySoftware Update, Transfer or Reset, Sharing

Important Notes

  • macOS Compatibility: These scripts work only on macOS 13.0 (Ventura) and later
  • User Experience: Disabled panels appear grayed out but remain visible
  • System Restart: Changes take effect immediately without restart
  • Persistence: Settings persist across user sessions and system reboots

For devices running macOS 12.x and earlier, use the legacy System Preferences management approach with different bundle identifiers.