Category filter

Script to hide the VPN icon from the menu bar on Mac

The menu bar on macOS devices makes it easy to access system settings and network settings like VPN, Wi-Fi, battery options, and much more. The VPN icon allows the users to connect to a VPN network without having to open the Networks tab from System Preferences. This document provides a bash script to remove the VPN icon from macOS devices. Admins can remotely execute the script through the Execute Custom Script option in Hexnode UEM.

Scripting Language – Bash

File extension – .sh


The Sample Scripts provided below are adapted from third-party Open-Source sites.

Remove the VPN icon from the menu bar

The delete command will delete the file in the path /System/Library/CoreServices/Menu Extras/ of the current user.


  • 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