Posted on 12-21-2022 11:28 AM
Hello,
I am looking for a way to update all of my current users name field in Jamf Pro to their full name.
Currently we have our LDAP setup between OKTA, jamf connect, and Jamf Pro. So when a user takes their device out of the box, they have to sign in with their OKTA credentials and Jamf sets the device up for them. Their full name, username(email address), and email address come over to Jamf Pro correctly. But the (computer?) name field comes over to Jamf Pro as Macbook Air. Link to screenshot of what I am looking at https://imgur.com/a/MyT8BSK
Is there a way to update this field to be their full name? And a way for future users to have it be their full name too? I assume you could script it somehow, but I am a scripting noob.
Thank you for assistance.
Posted on 12-21-2022 01:59 PM
The computer name is read directly from the computer during a recon. So this is the computer name the users are seeing. As you mention, your best best would be to create a simple script to do the following steps:
1) Get the current logged in user.
2) Read the Real Name from the dscl for the current logged in user
3) Use the jamf setComputerName command to set the computer name
4) Run jamf recon to update the computer name in Jamf
I know you mentioned that your are a scripting noob. This is a pretty simple and straight forward script. I would encourage you to try and build this script yourself. Use Google to find the commands you need. Take it one step at a time and build out your script. Once you have a working and tested script, add it Jamf and create a policy. (You probably want to scope it to run after enrollment, so you can get your user created first.)
HOWEVER, I am going to suggest you consider whether you really want/should have the computers names match the user's name. Remember the computer broadcast their name over the network and AirDrop. Putting user PII as the computer name, could expose the user. At best this bad for your users and, in some industries, may even be illegal. I would suggest you develop a different naming scheme for your computers that does not include any PII.