Skip to main content

Hi All,

    Our District is aiming to use Macbook Air for our next laptop refresh. We have Jamf Pro and on our way to get a subscription on Jamf Connect. Anyhow, when I created a script under Policies, the name is not changing. The naming convention that I wanted to use for all the M1's should be M1-"Serial Number". The script that I've created is below;

#!/bin/bash
$ sudo jamf setComputerName -name $M1-$serialNumber

scutil --set ComputerName $M1-$serialNumber
scutil --set LocalHostName $M1-$serialNumber
scutil --set HostName $M1-$serialNumber


exit

 

Please help?

Thank you and have a great one!

Sincerely,

Cesar

Honestly haven't seen that issue myself but like I said it is a separate policy that runs during enrollment.

 



It doesn't do any harm for me to run the policy again. I'm sure I will figure it out. It doesn't happen often enough to light a fire under me to get it solved.


when I run “jamf setComputerName -fromFile”

 

I get an error “You must specify a computer name.  Use the -name flag.”  The csv file contains the serial number followed by the computername.  shouldn’t this work?


I have a one liner you can use in Files and Processes>Execute Command. It’s what we use for our generic enrollment name:

/usr/local/jamf/bin/jamf setComputerName -target / -useSerialNumber -prefix "M1-"

 


Reply