EA for last logout?

corbinmharris
Contributor

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 2

DBrowning
Valued Contributor II

You can probably do something with

last $username | grep console

mm2270
Legendary Contributor III

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}'