Skip to main content
Question

Jamf Pro Script

  • September 19, 2024
  • 8 replies
  • 55 views

JamfAdmin2
Forum|alt.badge.img+6

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

AJPinto
Forum|alt.badge.img+26
  • Legendary Contributor
  • September 19, 2024

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
Forum|alt.badge.img+11
  • Contributor
  • September 20, 2024

Do you mean this?

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

JamfAdmin2
Forum|alt.badge.img+6
  • Author
  • Contributor
  • September 20, 2024

Do you mean this?

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

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:

YanW
Forum|alt.badge.img+11
  • Contributor
  • September 20, 2024

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
Forum|alt.badge.img+6
  • Author
  • Contributor
  • September 20, 2024

yea, maybe try it first


It was completed but no changes happended

 


YanW
Forum|alt.badge.img+11
  • Contributor
  • September 20, 2024

It was completed but no changes happended

 


update inventory


Jason33
Forum|alt.badge.img+13
  • Honored Contributor
  • September 20, 2024

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.

 


Forum|alt.badge.img+4
  • New Contributor
  • September 20, 2024

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.