How to disconnect RDP session from command line


This article refers to situations when admin users or regular users logged of from RDP session without actually pressing the "Logoff" button.
To identify the connected sessions try this:
1. Open command prompt.
2. Type qwinsta /server:Server IP Address
3. You should be getting a table with Sessions, state and ID.
4. Write down the ID of the user you want to logoff.

5. Type rwinsta /server:SERVERIP SessionID from Section 4