Skip to main content
Question

Script to update computer name at check in

  • August 17, 2017
  • 2 replies
  • 7 views

Forum|alt.badge.img+1

Hello,

I have not been able to figure out how to script in JAMF to have machines update their computer name at check-in. I'm aware of the "reset computer name" policy, but that won't work for what I'm trying to do going forward.

In short, I want my machines to update their computer name at check-in to; serialnumber-c

Any help? I'm running the latest version of Jamf, admin from MacOS, built of a Tomcat Apache Server.

2 replies

emily
Forum|alt.badge.img+26
  • Hall of Fame
  • August 17, 2017

You should be able to modify this to work:
https://github.com/smashism/jamfpro-scripts/blob/master/set_computerName.sh

Adapt it by getting the serial number as a variable to pass instead, something like:
SerialNumber=$(system_profiler SPHardwareDataType | awk '/Serial/ {print $4}')


Forum|alt.badge.img+2
  • New Contributor
  • August 18, 2017

I have to vouch for this script and say it works flawlessly; thanks @emily for providing it!