Skip to main content
Solved

Setting hostname by reading last computer's hostname


Forum|alt.badge.img+7
  • Contributor
  • 26 replies

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!

Best answer by AJPinto

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 original
Did this topic help you find an answer to your question?

2 replies

AJPinto
Forum|alt.badge.img+26
  • Legendary Contributor
  • 2725 replies
  • Answer
  • January 24, 2023

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.


Forum|alt.badge.img+7
  • Author
  • Contributor
  • 26 replies
  • February 1, 2023

Thanks for the help! 

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings