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:
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
#1 on 2016-Feb-24 Wed 02:03+-25200