Wednesday, April 10, 2013

Logoff Remote Desktop user remotely

In serveral situations, you might run into a situation where you can’t login to server using RDP because "The terminal server has exceeded the maximum number of allowed connection".
Even without asking the system admin you can detect and kill one of your already connected session and then login. Here is how we can do that:
We could use QWinsta windows tool to figure out what users are remotely connected to the server.
Replace the IP with your server IP.
Y:\>QWinsta /server:
 SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
 services                                    0  Disc
 console                                     1  Conn
 rdp-tcp#0         dbmgmt                    2  Active  rdpwd
 rdp-tcp                                 65536  Listen

I want to logout dbmgmt user. So I’ll have to take ID assigned to it and run the following command:

Y:\>logoff /server: 2 /v
Logging off session ID 2

No comments: