Jamf Pro Script

JamfAdmin2
New Contributor II

Hello,

Does anyone out there have a script in Jamf I can use that can auto fill the "Update user and location" section. I need it to work for computers that are being setup and deployed for the first time as well as computers that have already been deployed and are current. 

8 REPLIES 8

AJPinto
Honored Contributor III

If you require people to enter credentials to enroll, Jamf will automatically assign the device to whoever enrolls it. Devices can also be assigned with recon, but I would have to dig up the verb (for example have a function to see the userID of the logged in user, and pipe that in to recon to assign the device to that person).

 

You will want cloud identity or LDAP setup to actually pull in the correct information beyond the users name.

YanW
Contributor III

Do you mean this?

#!/bin/sh

loggedInUser=$(stat -f%Su /dev/console)
jamf recon -endUsername $loggedInUser

JamfAdmin2
New Contributor II

I would pretty much need the script to auto fill all of this user info within user and location:

 

Username:
Full Name:
Email Address:
Position:
Department:

yea, maybe try it first

JamfAdmin2
New Contributor II

JamfAdmin2_0-1726842904295.png

It was completed but no changes happended

 

update inventory

Jason33
Contributor III

Arent those fields populated by LDAP mappings? Do you have an LDAP server integrated with your Jamf instance? If not, start there. You'll also want to go in to Settings - Computer Management - Inventory Collection and make sure to check 'Collect user and location information from Directory Service'. When a recon is completed, that info should update, if its not already.

And one more thing...check your PreStage and confirm in Account Settings that 'Pre-fill Primary Account Information' is checked. That might help out as well.

 

odnlinx
New Contributor II

It might be more than what you need, but I suggest you look at SYM. https://snelson.us/2024/06/setup-your-mac-1-15-0-with-sym-helper-1-2-0-via-swiftdialog-2-5-0/ It streamlines the onboarding process for devices.