Set Jamf Pro computer name to name of computer

aalves
New Contributor

Hi all, the company I work for has a naming convention for all systems. Laptops are the serial number with a -L
Desktops are the serial number with a -D

I have written a script that handles this. The problem is the name does not update in the jamf pro admin console. Is there a way to make jamf pro pull the name from the computer?

3 REPLIES 3

jcarr
Contributor III

Easiest way would probably be to use the Jamf binary to update inventory after your script has set the computer name. Add this line below where your script sets the name:

/usr/local/bin/jamf recon

aalves
New Contributor

Thanks, I tried it and it worked. Will add it to the end of my script.

jared_young
New Contributor II

Are you able to post your script? I have a big deployment coming up and would like to see if I can get this working in my environment too. Thanks.