I'm running a shell script via Self Service. I'd like to identify the user currently logged into Self Service, not the user logged into the computer. Is that possible?
Solved
Self Service Logged in User
Best answer by millersc
Try this
#!/bin/sh
loggedInUser=$(stat -f%Su /dev/console)
selfServiceUser=$(defaults read /Users/$loggedInUser/Library/Preferences/com.jamfsoftware.selfservice.plist LastLoggedInUser "")
echo $selfServiceUserEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.
