Assigning a username to a device without JSS

joethedsa
Contributor II

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?

1 ACCEPTED SOLUTION

jared_f
Valued Contributor

@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.

e2ce4170eb93423cbbb2beb31abde7ab

View solution in original post

4 REPLIES 4

dpodgors
Contributor

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 )

joethedsa
Contributor II

@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.

jared_f
Valued Contributor

@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.

e2ce4170eb93423cbbb2beb31abde7ab

joethedsa
Contributor II

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