Category filter

Script to disable/enable Notification Center on macOS devices

Notification Center is a valuable tool in macOS devices that provides an overview of alerts and notifications, providing users timely updates. Although at times, Notification Center can be a major productivity hindrance disrupting the employees from focusing on their task at hand. With Hexnode, IT admins can now easily disable and enable the Notification Center using Execute custom script action.

This document contains sample code snippets that you can use to enable and disable the Notification Center on macOS devices.

Scripting Language – Bash

File extension – .sh

Disclaimer:

The sample scripts provided below are adapted from third-party open-source sites.

Disable Notification Center

Execute the script to disable Notification Center for the currently logged-in user.

Enable Notification Center

Execute the script to enable Notification Center for the currently logged-in user.

Notes:

  • The scripts provided are particularly suitable for devices with SIP disabled, such as Macs used to install and test drivers, kernel extensions and other low-level code during app development.
  • System Integrity Protection (SIP) needs to remain disabled for the above scripts to work. To turn off System Integrity Protection (SIP), restart your device in Recovery Mode and execute the csrutil disable command. After the Mac restarts, you can run the above scripts successfully.
  • Keep in mind that if you go back to Recovery Mode and enable SIP, the Notification Center will appear again. To turn on System Integrity Protection (SIP), restart your device in Recovery Mode and execute the csrutil enable command.
  • 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.

Warning:

Disable SIP temporarily to toggle the Notification Center and reenable it as soon as possible. Failure to reenable SIP when you are done with your requirement leaves your device vulnerable to malicious code.

  • Sample Script Repository