Category filter

Script to enable/disable AirDrop on Mac

AirDrop functionality lets users transfer files between nearby Apple devices. However, if you want to restrict file transfers via AirDrop in your corporate environment, you can restrict the AirDrop functionality. By executing dedicated terminal commands, you can disable or re-enable AirDrop whenever necessary. The Execute Custom Scripts action lets you remotely run these commands on macOS devices.


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

Disable AirDrop

Execute this script to disable the AirDrop functionality:

Enable AirDrop

The following script helps you to re-enable AirDrop functionality:


  • 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