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.  

https://thebackroomtech.com/2008/04/09/howto-remotely-disconnect-a-terminal-services-session/

https://anandthearchitect.com/2008/08/01/how-to-logoff-remote-desktop-sessions-via-command-line-tools/

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

 

Advertisements
Posted in SCCM

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

Archives
Follow me on Twitter
%d bloggers like this: