Sometimes you may not be able to login to a remote computer through RDP and you may want to disconnect active or disconnect RDP sessions.
Login to your client computer as a domain Admin user. Open cmd prompt with admin privileges.
The Ip address or domain name of the Remote server should be entered in place of SERVERIP
You will get a list of the Remote Sessions in the command window.
To remove disconnected sessions or logoff a user, use the following syntax:
rwinsta /server:SERVERIP SESSIONID
For example in order to terminate the session of the Administrator user the following command should be given.
rwinsta /server:10.10.1.10 2