Category Filter

Script to rename Mac

A Mac device can be identified using the computer name or the local hostname. A Mac’s computer name is displayed on top of the Sharing preferences pane, and the local hostname is displayed right below the computer name. By default, the local hostname of your device is your computer name with “.local” added to the end, and all the spaces are replaced by hyphens.

This doc guides you on how to change the device name of your Mac, also referred to as the computer name using Hexnode’s Custom Script feature.


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

Change the computer name

Change the local host name


  • 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.