Auto-naming computers from a database


The default behaviour of macOS for naming a computer is that the name is based on the first user account created via the Apple Setup wizard. Therefore if the first user name is 'John Doe' the computer will be named 'John Doe's Computer'.

Clearly this format is not suited to an enterprise environment.

Historically Mac admins may have used DeployStudio which had a built-in function to auto-name computers based on a database stored in DeployStudio. Unfortunately Apple have conspired to kill off using DeployStudio for both installing the operating system and for running its workflows that would have included the step to auto-name the computer. Whilst there was a way to still use DeployStudio for macOS Mojave with macOS Catalina this now seems completely impossible.

Equally unfortunately Jamf does not have a similar built-in function that would auto-name computer based on a database list but at best could run a script to name computers based on the serial number.

I have therefore written an example script which can be run via Jamf and will read an entry from a database and use this to auto-name the client Mac computer. This could be run as a post-enrolment task including after DEP enrolment which is what Apple are forcing us to use these days.

(There are advantages and disadvantages to use DEP but the fact you cannot add older pre-DEP purchased Macs to your DEP account even those capable of running Catalina is a huge pain in the butt.)

The example script is actually written to utilise DeployStudio, obviously installing a new DeployStudio server purely for this purpose would be overkill but if you have one you could continue to use it for this purpose. Otherwise the script would be adaptable to use other database sources.

See -

Note: I am aware that after a computer is added to Jamf you could rename it in Jamf. However if you chose to delete that computer record completely before re-enrolling that information would be lost.


Contributor II

I have been using this script:

New Contributor III

@jkaigler Thank you for sharing the link to the blog post. I’ve been searching for a way to automate the more manual process of using the JSS MUT to import computer names.

Do you know if it can update Asset IDs and Mobile Device Names as well?

Contributor II

@dwaterbury I do not know if it can update Asset ID's. We do not use JAMF for mobile devices but I would think it update those as well, but not sure.