I've been looking at qwinsta and query session, but as far as I can see they don't provide any time info.
I have several users remote accessing several development servers and not all of them are very good at remembering to sign out/log off their remote sessions when they are done – instead they disconnect.
I know that you can make Group Policies and other options that sign out people after a specific time period, but I would like to script it, so I can have exceptions depending on specific users and time since disconnect.
So if I could find the time when a user disconnected I could schedule a daily check that compares against the disconnect time and the users, and if everything fits, sign out the users (- which in turn triggers a series of other checks and commands). The only part that I'm missing is the time information . . .