Posted on 11-09-2016 03:10 PM
Hey folks,
Was wondering if there is a way to automatically upload Local user information from the machine to JSS?
The Mac already collects Full Name and Short Name, and we just want it to be able to upload that to JSS so the User and Location fields get populated with Full Name and Shortname
Thoughts?
Thanks in advance!
Posted on 11-09-2016 03:40 PM
@mitulpatel2003 sure you can do this. You'll need to use dscl
to pull the info from the local machine and the jamf
binary with the recon
verb to do so. This is a rough, not tested, script you could use. Just one way to do it.
#!/bin/bash
loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`
firstName=`dscl . read /Users/${loggedInUser} FirstName | /usr/bin/awk '{ print $2 }'`
lastName=`dscl . read /Users/${loggedInUser} LastName | /usr/bin/awk '{ print $2 }'`
fullName="${firstName} ${lastName}"
shortName=`dscl . read /Users/${loggedInUser} RecordName | /usr/bin/awk '{ print $2 }'`
jamfCall="jamf recon -endUsername ${shortName} -realname '${fullName}'"
${jamfCall}
Posted on 11-10-2016 09:14 AM
@stevewood Thanks so much! going to try this out later today!
Thanks again!