Posted on 05-21-2018 12:32 PM
for some reason sometimes, when I connect to a computer via jamf Remote - it loads screen sharing, and I decide not to share screen, but to log in using another account. - Install update, remove files etc whatnot.
then I log out - but end user cannot restart computer, as the admin account is still logged in
whats the best way to log out the admin user remotely, using Execute command ?
Posted on 04-30-2019 06:07 AM
Has there ever been a solution discovered to this issue?
Posted on 04-30-2019 07:21 AM
I don't know that I've ever run into this issue, but I imagine you could run a command to get the loginwindow PID for the user you had logged into and might still be active, and then use that in a kill command to shut down their session. Something like the following, but replacing <username>
with the actual user account name.
PID=$(ps axuc | awk '/<username>/ && /loginwindow/{print $2}'); /bin/kill -9 $PID
I would test that out thoroughly before using it on production machines to be sure there are no adverse effects. It's never a great idea to kill the loginwindow of a user session, but I suppose sometimes it's just necessary.