Changing Mac Names with Terminal

Sometimes after imaging, the computer name is wrong being “iMac-abunchofrandomcharacters” or just “iMac (#)”. This causes helpdesk to not be able to pull the IP address and makes remoting in difficult.

Open Terminal and run the following command lines (replacing * with the correct computer name from Helpdesk):

sudo scutil --set HostName *
sudo scutil --set LocalHostName *
sudo scutil --set ComputerName *
dscacheutil -flushcache

sudo jamf -setComputerName -name *

Restart the iMac and the name should be fixed. Check the device page on Helpdesk to make sure it’s pulling the IP address.

This entry was posted in CSR Documentation, Mac. Bookmark the permalink.