Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

find user disconnection time in RDP session Windows server 2012

We have a pool of develop machines where developers log in through RDP and usually they doesn't log off but just disconnect. As local administrator I can force the log off but I would like to check when the user disconnected.

From task manager I can see only the user name and its status

enter image description here

Is there a way to discover when the user disconnected using task manager, powershell, cmd or whatever?

like image 545
Naigel Avatar asked Aug 24 '15 08:08

Naigel


1 Answers

You can use windows command query user UserName /server:ServerName or you can just enter query user /server:ServerName to find out all active or disconnected sessions.

Below is the sample output, I have blurred out my info for privacy:

enter image description here

I have also created a PowerShell script to do this task automatically, here is the link Powershell to find out disconnected RDP session and log off at the same time

like image 174
LT- Avatar answered Sep 21 '22 00:09

LT-