Skip to main content
Question

Logging out user after remote screen sharing

  • May 21, 2018
  • 2 replies
  • 7 views

Forum|alt.badge.img+6
  • New Contributor
  • 9 replies

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 ?

2 replies

Forum|alt.badge.img+1
  • New Contributor
  • 1 reply
  • April 30, 2019

Has there ever been a solution discovered to this issue?


mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • 7886 replies
  • April 30, 2019

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.