Posted on 01-11-2024 05:25 PM
Hi Guys
we connected JAMF connect to Okta but after user enrollment we see the device name its Macbook how we can able rename that to user first and last name base on okta information
Posted on 01-11-2024 11:03 PM
you need a script running through the enrollment process, search for it, there are many solutions ;-)
Posted on 01-12-2024 08:21 AM
Do you have one ?
Posted on 01-12-2024 07:24 AM
I think you should really reconsider that naming scheme. You will be broadcasting that user's name to every network they connect to and to every device around them that wants to connect. It's a huge privacy issue, and one that doesn't seem to have any pro to balance that out.
Posted on 01-12-2024 08:29 AM
I agree with @McAwesome. I see this type of question a lot here. Some people are not aware that it's possible to include a lot of user details in a computer record in Jamf, without needing to have that info in the computer name itself. If the concern is "how do I know who is using this Mac?", then the answer to ensure you correctly populate the User & Location Details section for the device, not to use the user name in the computer name.
There are some automated ways of doing this, and some scripted processes, but I think no matter what auth or IdP you use, it's possible to pull some of this info and add it to the computer record. It's a much more reliable (and safer) way of having user details to search on.
01-15-2024 09:29 AM - edited 01-15-2024 09:30 AM
The way the reset name feature in Jamf works is: whatever string is in the computer name field in Jamf at the time of inventory collection will become the name of the comptuer as if it were set with
scutil --set ComputerName someName
There are several ways of populating these names in the Jamf computer records: you can click through & find the ones you want to set in the GUI, you can use Inventory Preload (look up in Jamf Pro docs...) you can write an API script to upload computer names to computer records based on some other matching attribute like Jamf Computer record object ID, or serial number or hardware UUID, or, etc...
Posted on 01-16-2024 11:32 AM
thanks all guys
i use this Script now and working fine but adding Device model to end of the name do you have any suggestions about that
Posted on 01-16-2024 11:34 AM
#!/bin/bash
# Set variables
# Get the last logged in user
lastLoggedInUser=`defaults read /Library/Preferences/com.apple.loginwindow lastUserName`
# Get Model Name of computer
modelName=`system_profiler SPHardwareDataType | grep "Model Identifier" | awk '{print $3}' | sed 's/[0-9]*//g' | tr -d ','`
# Get original name of computer
oldComputerName=`scutil --get ComputerName`
# Generate new computer name
computerName=$lastLoggedInUser-$modelName
# Set new computer name locally
scutil --set ComputerName $computerName
scutil --set HostName $computerName
scutil --set LocalHostName $computerName
# Set the computer name in Jamf to reflect what is set locally on the computer
/usr/local/bin/jamf setComputerName -name $computerName
/usr/local/bin/jamf recon
echo "Computer name has been changed from $oldcomputername to $computerName"
exit 0
Posted on 02-21-2024 04:36 PM
I guess question 1 is which model? Model identifier, model number, model marketing name?