Skip to main content

I'm looking for a way to assign a username like you can in JSS (Inventory > User and Location) but would like to do it via a dialogue box (oascript?) outside of JSS on a Mac via
Self Service. We have our JSS synced with Active Directory (AD) via LDAP. When we enter a username in JSS, it will auto populate other attributes for that account from AD which is saving us time. This policy would be done by someone that doesn't have access to JSS but will have access to Self Service for prepping the computer for a user. This will probably have to be accomplished via the JSS API but not sure where to start. Anyone else doing anything like this?

If you want to just take the user that is logged in at the time, when they run Self Service item:
sudo /usr/local/jamf/bin/jamf recon -endUsername $( ls -la /dev/console | cut -d " " -f 4 )


@dpodgors, thank you for your contribution. This definitely gets the username into Jamf the correct way, however it doesn't auto populate the rest of the information from AD as it would if I did it manually in Jamf...any ideas? I did a second recon hoping that it would pull it but it did not.


@joethedsa Attach the scrip to a policy and add update inventory. Then make sure that "Collect user and location information from LDAP" is checked in Inventory Collection settings. I believe this should sync the users info into the JSS.




@jared_f, Thank you. Changing that setting did the trick. Thanks to all for your contributions!