Is there a quick and easy way to see users' session idle time on an RDP server?
Thanks
5 Answers
Terminal Services Manager can get you this information.
Under administrative tools -> Terminal Services -> Terminal Services Manager
Then select the host in the left pane and in the middle pane select the "Sessions" tab. There will be a listing of all active sessions and there is an "IdleTime" column.
The output is intererpeted as "Days+Hours:minutes". So for example, if the output is "4+11:23" the user has been idle for 4 days, 11 hours, and 23 minutes.
It's also worth noting that you can log these sessions off by right clicking and disconnecting them. Though it might be nice to pay them a phone call first :P
Edit: Well that's a good answer for versions of Server prior to 2012 :( But since they eliminated Terminal Services Manager from newer versions of Server, it seems like this powershell script might be the best option:
I assume that the IdleTime is being reported in minutes, since my initial tests only display single integers.
3Since Windows 2008 the command quser works.
Displays information about user sessions on a Remote Desktop Session Host (RD Session Host) server.
In fact, the PowerShell script linked to in answer simply runs this command. OP asked for a quick and easy way, this is definitively quicker than to download and execute PS-script.
Example from Windows Server 2012 R2:
C:\Users\admin.tedd>quser USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME admin.xxxxxxxx 2 Disc 15+15:12 7/20/2017 1:19 PM admin.xxxxx rdp-tcp#54 3 Active 1:39 7/21/2017 5:35 AM xxxxxxxx 4 Disc 6+04:10 7/21/2017 9:25 AM >admin.tedd rdp-tcp#86 5 Active . 8/9/2017 4:40 PM
Number in front of + is days, so 15+15:12 is 15 days, 15 hours and 12 minutes.
Note! Documentation says this is the same as running query user. The command query does not exist on my servers. Not sure if this is separate install or part of a feature install.
in command prompt (CMD) just type:
query user
Then it will show you the result.
3You can use powershell to locate various users or multiple server's idle time The script was created by user "Cookie.Monster" on technetGet-UserSession - Parse query user result
More detail of the script, and usage can be found in the link above
Get-RDUserSession |ft Username,Idletime
Get-RDUserSession |select-object UserName,Servername,IdleTime,CreateTimeJust a few examples – the BIG issue is converting the "idletime property" which is some integer of time Example: 6667354 converted to Days:HH:MM:SS
I have not figured that out yet.
2