Workaround for Script Parameter $3?

pchang
New Contributor

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.

Script Parameters

3 REPLIES 3

leslie
Contributor II
Contributor II

You can grab the logged in user using either:
/usr/bin/stat -f%Su /dev/console
or
/usr/bin/python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + " ");'

isaacnelson
Contributor

@pchang, have you opened a case with Jamf about this issue? Might help to bump it up the priority list if they know it's causing specific problems for you.

pchang
New Contributor

For those that are curious, here is the product issue number: PI-006954