Note: The script for blocking external storage devices has been deprecated. To block and monitor all USB and external storage devices, kindly leverage Device Control module.
For more information on how to block USB devices on Mac machines, click here.