Applying previously saved name at re-enrollment

MattF-TX
New Contributor II

I'm wondering if there's the ability to apply a Mac's previous name as it is in Jamf, at the time it is reenrolled or as a post-re-enrollment process after it has been wiped and reloaded with a fresh OS.  Right now there is the ability to create a policy to run with the “Enrollment Complete” trigger and possess a Maintenance payload with the “Reset Computer Names” checked.

Unfortunately though when enrollment completes, before the aforementioned policy has a chance to run, an inventory update is run (a built-in part of the enrollment process) which of course causes the Mac’s existing name in Jamf to be changed and overwritten to the default “iMac” name it automatically gets when installing an OS.

By the time the above "Reset Computer Name" policy runs, the Mac’s name in Jamf has already been set to the generic “iMac” due to the forced inventory update at the time of enrollment.

We currently name our Macs based on location (building and room number) along with the asset tag number, and having to do that manually for existing Macs just seems like the dark ages.

This is probably a pipe dream, but what would be nice would be to have the ability re-enroll existing Macs, without an inventory update being immediately ran.  Perhaps a special PreStage Enrollment setting that applies to Macs with existing Jamf entries, allowing their previous name in Jamf to be reapplied, and then running any inventory update after that.  Of course for new Macs or Macs that have not yet been enrolled in Jamf, that setting would be completely inert, as there would be no existing Jamf entry for it to query and apply.

1 ACCEPTED SOLUTION

Jay_007
Contributor

Assuming that the inventory information is being retained after erasing, why not use API in a script to pull out the information you need (if it exists) for the name then piece it together and then rename it? Something like this might help:

https://community.jamf.com/t5/jamf-pro/renaming-computers-using-asset-tag-data-api/m-p/256085/highli...

OR

https://community.jamf.com/t5/jamf-pro/leveraging-api-to-rename-computer-in-script/m-p/278682/highli...

 

This won't help with naming the Macs to begin with though, but will sort out your re-enrolling naming issue.

Personally I prefer to stick with a simple naming convention i.e. MAC-%SERIALNUMBER% and then use Network segments to automatically assign the correct Buildings and Department based on IP address. Then you can use Smart groups to group locations for scoping. The only thing you need to do manually in this case would be the asset tag (which can also be automated if you use some like the serial number here too).

View solution in original post

2 REPLIES 2

Jay_007
Contributor

Assuming that the inventory information is being retained after erasing, why not use API in a script to pull out the information you need (if it exists) for the name then piece it together and then rename it? Something like this might help:

https://community.jamf.com/t5/jamf-pro/renaming-computers-using-asset-tag-data-api/m-p/256085/highli...

OR

https://community.jamf.com/t5/jamf-pro/leveraging-api-to-rename-computer-in-script/m-p/278682/highli...

 

This won't help with naming the Macs to begin with though, but will sort out your re-enrolling naming issue.

Personally I prefer to stick with a simple naming convention i.e. MAC-%SERIALNUMBER% and then use Network segments to automatically assign the correct Buildings and Department based on IP address. Then you can use Smart groups to group locations for scoping. The only thing you need to do manually in this case would be the asset tag (which can also be automated if you use some like the serial number here too).

MattF-TX
New Contributor II

Hi Jay.

Apologies for not responding sooner.

Greatly appreciate your feedback and the idea of using API in a script and the links.  I'm definitely going to pursue that route.  It would be really nice if Jamf had a checkbox or something when configuring the PreStage Enrollments that allowed for applying the previously saved computer name, prior to performing an inventory update.  That said, I am indeed going to look more into the solution you provided.

Thanks again Jay!