Killing user session remotely – windows

No Comments

Some times we may need to kill the user session remotely when we do not have enough connections to connect through RDP.  We will get the message “The terminal server has exceeded the maximum number of allowed connections.” when there are not enough connections to the windows 2000/2003/2008 server.

Microsoft provided some tools (sysinternals) to execute the commands from remote computer.

We should download the sysinternals tools psexec to execute the commands remotely.  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 command 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.

Process Explorer

No Comments

When I want to find out the details of all processes running in my windows 2003 server, I found an excellent utility from sysinternals which gives all the details of all processes.

We can download this utility free of cost from sysinternals site at http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

Along with the features provided by Task manager like Killing process, setting priority and affinity, this provides additional features like

1.  Properties of the process
2.  Finding the handler for the process
3.  Live CPU activity graph
4.  Suspend the proces
5.  Alter Service process security
6.  Registries associated with the process
7. Threads associated with the proces
8.  Shows system usage like CPU Usage, Commit, I/O Bytes, Physical etc.,