Posted on 02-15-2022 05:08 PM
I am looking for a script to deploy via policy. The naming convention we have adopted is (department, login user, -L). So for example a laptop name would be ITUSER-L. I have created a static group called IT but can't figure our how to make the script to collect the department information. We use jamf connect (Okta as our IdP), if there is an easier way to do this via jamf connect that would work too. Thanks.
Posted on 02-16-2022 04:14 AM
you may push the department info to the client using a configuration profile with paload variables, see https://docs.jamf.com/10.34.0/jamf-pro/documentation/Computer_Configuration_Profiles.html how to do it.
If you use "tld.company.macclient" as preference domain for the Profile and "DepartmentName" as key, your script can then read the information using
defaults read /Library/Managed\ Preferences/tld.company.macclient.plist DepartmentName
The computer name can be set in your script using jamf setComputerName (see https://docs.jamf.com/10.34.0/jamf-pro/documentation/Renaming_a_Computer.html)
Posted on 02-17-2022 11:49 AM
Thanks Andreas42. I will try that and report back on the thread.
Posted on 04-08-2022 08:51 AM
Sorry I am a little confused, when you say "tld.company.macclient" are you referring to my domain? not familiar with tld, I might be misunderstanding. Thanks.
Posted on 04-08-2022 10:29 PM
I refer to the preference domain used in the configuration profile.