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.
Change the computer name
1 2 |
#!/bin/bash scutil --set ComputerName $ComputerName |
Change the local host name
1 2 |
#!/bin/bash scutil --set LocalHostName $LocalHostName |