How to Logoff Remote Desktop sessions through command line.

Some times your sessions will not get disconnected correctly from remote servers, due to network issues or other technical issues.

When you try to login to the same server again it will give you only the blank screen with no option to do anything on the server, or in some cases where terminal service connections are restricted to limited numbers you will see the error “The terminal server has exceeded the minimum number of allowed connections ”

During this time you need help from your colleague to log off your session from the server so that you can login again and it will allow new connections for others, but it is not possible in all the cases.

We can do this by our self with Qwinsta and Rwinsta commands.

Credit to the some of the blogs about these commands.

All we need is to login to any other server in the same domain and run below commands.

To get the remote sessions we need to run the below command.

Qwinsta /server:servername 

To close the session we need to run the below command.

Rwinsta /server:servername session ID


Posted in SCCM

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Follow me on Twitter
%d bloggers like this: