Quick Tip: Get a list of users logged into a Remote Desktop Services server and then log specific users out

I discovered this tip on another site this morning but in all my years, I’d never even heard of this method so I thought I’d pass it along in case anyone else was like me.

If you are working from the command line and would like to see all of the users logged into an RDS server, use the following command:

qwinsta /server:SERVERNAME

It will enumerate the list of user IDs logged into that server, and then you can just take the session ID number from the session you want to log off and use:

logoff SESSIONID /server:SERVERNAME
Revision List

#1 on 2016-Feb-24 Wed  02:03+-25200