Kill a remote user session remotely

When trying to connect to your Windows 2000/2003 server remotely, you may receive the following error.
"The terminal server has exceeded the maximum number of allowed connections."

 

You could kill one or more of those connections by using PsExec tool that can be downloaded from the following link. This tool and a bunch of others were developed by SysInternals which was bought by Microsoft.
http://www.microsoft.com/technet/sysinternals/utilities/pstools.mspx

 

Open your command prompt and from the directory that contains the psexec utility, do the following

1) psexec \\x.x.x.x -u user -p password cmd (this will give you access to the cmd prompt on the server)
Example: psexec \\127.0.0.1 -u admin -p password cmd

 

2) once you get the command prompt run the command qwinsta to get a list of all Terminal Services connections. Each connection has an Id Number.

 

3) Run the command logoff [id# of session to quit] /v (this will kill the connection with that id #)
Example: logoff 2 /v

 

Once you killed a connection, you can use your remote desktop connection to login to the server remotely.

Post a Comment