Does anyone know of a workaround to get user input from Self Service either than using the script parameter $3?
We have noticed since the JAMF PRO JSS 10.11.1 update, this is broken. We utilize this parameter heavily when onboarding in August, for about 1200 students and their machines, grabbing their login ID from Self Service to rename their machines. Which puts these computers into special smart groups, which then our JSS syncs with our wireless network access control system for students to gain access to our wireless network. What we are noticing is that instead of $3 outptutting, "ldapuser/ActiveDirectoryUser" it's spitting out "localuser" from the machine.
The latest update for JAMF PRO, 10.12 did not address this. I think JAMF is aware of this, although it isn't listed in known problems.
We are trying to be proactive in the event this isn't fixed by the JAMF devs by August. If anyone has any ideas, it will be appreciated.
You can grab the logged in user using either:
/usr/bin/stat -f%Su /dev/console
/usr/bin/python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None]); username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + " ");'