Sqlserver-dba.com

How to View Remote Desktop Sessions

I receive sometimes the following message when attempting to start a new Remote Desktop Session onto a Windows 2003 server.

 The terminal server has exceeded the maximum number of allowed connections

 If you are on a client machine and logged on as a domain Admin, the the following command from the command prompt will display users:

qwinsta /server:SERVERIP

 Replace SERVERIP with either ipaddress (or domain name) of the Remote Server

 An example :

 qwinsta /server:PIRANHA

 You’ll see a list of users with various states

 

 

SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE

Rdp-tcp#47                  user1                          4    conn        rdpwd

Rdp-tcp#48                  user2                          5    Active        rdpwd

 

 

To disconnect  a remote session use the command:

 

rwinsta /server:SERVERIP SESSIONID

 

Replace SESSIONID with the ID – so extending our example , to disconnect the second listed user do :

 

 

rwinsta /server:PIRANHA 5

Ref:Jack Vamvas (http://www.sqlserver-dba.com)

 


Author: Jack Vamvas (http://www.sqlserver-dba.com)

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact