Skip to main content
Question

EA for last logout?

  • February 21, 2018
  • 2 replies
  • 9 views

Forum|alt.badge.img+11

We require users to logout after they are done with their work for the day. However, as everyone knows, Mac users do not always logout.

Is there an extension attribute that can be used to collect info for "no logout in X number of days"

Thanks! Corbin

2 replies

DBrowning
Forum|alt.badge.img+25
  • Esteemed Contributor
  • February 21, 2018

You can probably do something with

last $username | grep console

mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • February 21, 2018

There might be a better way, but the last command will show something like still logged in to the right of any accounts that haven't logged out yet. The problem is the date format is kinda lame, as it might show it something like Wed Feb 14 23:05, which isn't the most helpful output.

Anyway, try playing around with
last -t console | awk '/still logged in/{print $1,$3,$4,$5,$6}'