Setting hostname by reading last computer's hostname

Nate1
New Contributor III

Hi all!

We are working on creating a pretty basic hostname convention: setting it to [firstname].[lastname][#]

While it's of course simple enough to set the first.last and append with a number, the hard part is if a user receives a second machine (or 3rd, 4th, etc).

If Bob Smith is hired and we set his machine to bob.smith1, that's fine, but if in 3 years he qualifies for a new machine, we don't know how to automatically have it set to bob.smith2.

Is there a way to read hostnames from Jamf Pro? I've looked into reading from a csv or Google Sheet, but the problem is then keeping either of those regularly updated.

We've also looked into [first].[last].[serial], as the serial is of course unique, but we occasionally have users with longer names and would run into issues trying to append the whole, or even parts, of the serial number.

We're open to hostname conventions others use, but we found this to be the easiest to manage as everything else we need can be pulled from the Jamf entries of each machine, so there was no need to set something too complicated as the hostname.

Thanks for any help or ideas!

1 ACCEPTED SOLUTION

AJPinto
Honored Contributor III

There is not a way to do this that I am aware of. It may be possible with a script that uses JAMF API, but would be fairly messy to script.

 

Honestly, putting personally identifiable information in a hostname is a security risk. Those hostnames are broadcasted publicly on any network and can be seen by various devices in the wild. I would stick with just using the SN as the devices hostname.

View solution in original post

2 REPLIES 2

AJPinto
Honored Contributor III

There is not a way to do this that I am aware of. It may be possible with a script that uses JAMF API, but would be fairly messy to script.

 

Honestly, putting personally identifiable information in a hostname is a security risk. Those hostnames are broadcasted publicly on any network and can be seen by various devices in the wild. I would stick with just using the SN as the devices hostname.

Nate1
New Contributor III

Thanks for the help! 

We've decided to do as you suggest and mostly stick with the SN as the hostname.