Hello JAMF Nation,
Has anyone out there successfully been able to determine the currently logged in user to Self Service?
I am trying to determine via script what the current "logged in user" is in Self Service in this fashion.
"Logged in user is <username>"
or
"No user currently logged in"
The ~/Library/Preferences/com.jamfsoftware.selfservice.plist has a key for the "LastLoggedInUser", which I have been able to parse out with the following terminal command:
/usr/libexec/PlistBuddy -c Print:LastLoggedInUser /Users/"$loggedInUser"/Library/Preferences/com.jamfsoftware.selfservice.plist | tr -s '@' '@'
However, when a user logs out, the key remains in the plist. I have not found a way to efficiently determine if a user is logged in or not. Has anyone else had to solution for this?
Any feedback is appreciated. I am attaching a screenshot of FSEventer for what files are touched, modified, or removed when logging in and out of Self Service.
Thanks!