How to View / Disconnect Remote Desktop Sessions from Commandline

by Strider on January 26, 2009

in Tips 'n' Tricks

I used to receive the maximum number of connections error message when I try to log on to the Windows 2003 Server in my office via Windows Remote Desktop.

“The terminal server has exceeded the maximum number of allowed connections“

Session Exceeded

This is pretty annoying if you have some urgent work to do in the server. Most of the already logged in users won’t even be using the session at the time, but I can’t login! So how to solve this? After a bit of googling, as usual, I found a simple way to disconnect other remotely logged in sessions. :D

First of all you must be logged in to your client computer as a domain Admin user. Now open the command prompt and type in the following command.

qwinsta /server:SERVERIP

The Ip address or domain name of the Remote server should be entered in place of SERVERIP

Example:

qwinsta /server:10.10.1.10

You will get a list of the Remote Sessions in the command window.

Remote sessions list

In the above sceenshot we can clearly see an Active RDP session with the ID 2 which belongs to the user Administrator. In order to disconnect that user we are going to use the session ID. Use the following command line to disconnect the remote session.

rwinsta /server:SERVERIP SESSIONID

For example in order to terminate the session of the Administrator user the following command should be given.

rwinsta /server:10.10.1.10 2

Disconnect Remote Session

Now let’s confirm if the user is really disconnected. Just type in the qwinsta command in proper format.

Disconnected Remote Sessions List

As you can see our session with ID 2 is no longer there. Now for the user we just disconnected will see the following message.

Disconnected-Server-Session

The remote session was disconnected because you session was logged off at the remote computer. Your administrator or another user might have ended your connection.

So we are done with the remote session management over command lines.

{ 86 comments… read them below or add one }

Ajay

1 March 28, 2012 at 11:55 am Thumb up 3 Thumb down 0

please tell me meaning of session forced out and session forced off

Reply

mixanobios

2 April 20, 2012 at 3:53 pm Well-loved. Like or Dislike: Thumb up 5 Thumb down 0

BRAVO! thanks

perfect!

Reply

Markus

3 May 23, 2012 at 12:50 pm Thumb up 0 Thumb down 0

You could use the console-connection with Remote Desktop too. Just launch “mstsc.exe /console” and connect as normal. More information: http://ss64.com/nt/mstsc.html

Reply

Rafik Kureshi

4 October 22, 2012 at 2:27 pm Thumb up 1 Thumb down 0

Thank you very much……..

Reply

Klaus Jensen

5 October 24, 2012 at 1:01 pm Thumb up 0 Thumb down 0

Did not work for me, but using the logoff command specified in this article did:

http://www.danrigsby.com/blog/index.php/2008/08/26/remotely-log-off-remote-desktop-users/

Reply

Geeker

6 November 2, 2012 at 6:48 pm Thumb up 3 Thumb down 0

Excellent , also you can try this :
query session /server:SERVERIP

reset session SESSIONID /server:SERVERIP

Reply

Adil Mahmood

7 November 22, 2012 at 5:13 pm Thumb up 0 Thumb down 0

Thanks!

Works perfect

Reply

2ndGenCoder

8 January 16, 2013 at 8:41 pm Thumb up 0 Thumb down 0

works for me. Thanks!

Reply

Amitsingh

9 January 30, 2013 at 10:10 pm Thumb up 0 Thumb down 0

Thank you All of you,

Thanks for sharing information. kindly Tell me how to schedule the all user Session disconnect / session forced out on at time.

Reply

http://blogs.Albawaba.com/Estellachr

10 April 27, 2013 at 12:11 pm Thumb up 1 Thumb down 0

It is truly a nice and helpful piece of info. I’m satisfied that you just shared this useful info with us. Please keep us informed like this. Thank you for sharing.

Reply

Darnell

11 May 9, 2013 at 3:46 am Thumb up 0 Thumb down 0

Hi there colleagues, good article and nice arguments commented here,
I am truly enjoying by these.

Reply

genf20 plus

12 May 13, 2013 at 9:10 pm Thumb up 0 Thumb down 0

Hi there, I want to subscribe for this website to take latest updates, thus where can i
do it please help.

Reply

komunikacja wewnetrzna

13 May 18, 2013 at 12:08 pm Thumb up 0 Thumb down 0

Whats up are using Wordpress for your blog platform? I’m new to the blog world but I’m trying
to get started and create my own. Do you require any html coding expertise to make your own
blog? Any help would be greatly appreciated!

Reply

mememe

14 May 20, 2013 at 3:59 pm Thumb up 0 Thumb down 0

No expertise required
Being a casual user would be sufficient for most blogsites

Reply

huddlebuy

15 May 24, 2013 at 2:15 pm Thumb up 0 Thumb down 0

Superb, what a blog it is! This blog presents helpful information to us, keep it
up.

Reply

the best juicer

16 May 26, 2013 at 10:13 am Thumb up 0 Thumb down 0

Excellent blog right here! Additionally your web site a lot up fast!
What host are you the use of? Can I am getting your associate link for your host?
I want my website loaded up as quickly as yours lol

Reply

Myron

17 June 3, 2013 at 11:27 am Thumb up 0 Thumb down 0

Hey there, I think your blog might be having browser compatibility issues.

When I look at your blog in Ie, it looks fine but when opening
in Internet Explorer, it has some overlapping.

I just wanted to give you a quick heads up! Other then that, fantastic blog!

Reply

Joker Beatbox Style

18 June 6, 2013 at 6:33 pm Thumb up 0 Thumb down 0

I do not even know how I finished up here, however I thought this publish was
good. I don’t recognize who you’re but definitely you are going
to a well-known blogger in the event you are not already.
Cheers!

Reply

Logan

19 June 16, 2013 at 5:36 am Thumb up 0 Thumb down 0

I like what you guys tend to be up too. This kind of clever work and reporting!
Keep up the wonderful works guys I’ve added you guys to blogroll.

Reply

Maxie

20 June 18, 2013 at 2:13 am Thumb up 0 Thumb down 0

Great post. I was checking continuously this blog and I am
impressed! Extremely useful information specifically the last part :) I care for
such information a lot. I was seeking this particular information for a very long time.
Thank you and good luck.

Reply

Nell

21 June 20, 2013 at 12:59 pm Thumb up 0 Thumb down 0

I have been browsing on-line greater than 3 hours
as of late, yet I by no means found any fascinating article
like yours. It’s lovely worth sufficient for me. In my opinion, if all web owners and bloggers made just right content as you did, the net will likely be a lot more helpful than ever before.

Reply

Allison Reining

22 June 21, 2013 at 7:28 pm Thumb up 0 Thumb down 0

Hi!
Others have voiced my confusion above, but it’s nice sometimes to add for the melee. I’ve been signed up since the middle of January, but have three letters. They’re great letters! But similarly, I’d like to know if this is just the process in the dust settling or if this is to be expected?
Thanks!

Reply

ana tranny sex

23 June 30, 2013 at 10:07 am Thumb up 0 Thumb down 0

This article will help the internet people for building up
new website or even a blog from start to end.

Reply

Catherine

24 July 3, 2013 at 6:22 pm Thumb up 0 Thumb down 0

How can I connect direct to my Remote Desktop Connection, Client terminal. Client is connected through Server/client environment using proxy. My server IP Address is XXX.XX.XXX.XXX with client as 192.168.0.11 port 8080. Can anyone help me out. Thanks

Reply

Al

25 July 17, 2013 at 1:54 am Thumb up 0 Thumb down 0

Very helpful! I had to deal with this issue every day, for a while and you helped me with your post! Thanks very much.

Cheers,

Al

Reply

web site

26 August 8, 2013 at 8:45 am Thumb up 0 Thumb down 0

Wonderful blog! Do you have any helpful hints for aspiring writers?
I’m hoping to start my own site soon but I’m a little lost on everything.
Would you advise starting with a free platform like Wordpress or go for a paid option?
There are so many choices out there that I’m completely overwhelmed .. Any recommendations? Bless you!

Reply

MRR0811

27 September 3, 2013 at 10:01 am Thumb up 0 Thumb down 0

Nice tips just a question – Any way to view the applications open in the respective sessions.

Reply

electric smoker compare99

28 December 11, 2013 at 2:11 pm Thumb up 0 Thumb down 0

I amm not ѕure where you aare getting your info, but good topic.
I needs to spend some time learning much more or understanding more.

Thanks for wοnderful information І was looking for thijs
info for my miѕsion.

Reply

pregnant wisdom toothache

29 December 12, 2013 at 2:24 pm Thumb up 0 Thumb down 0

Whoa! Тhis blog loοkѕ exactly lijke my оld one! It’s on a entirelу different topic but it has pretty much the same
layоut and design. Great choice of cоlors!

Reply

http://www.leogiamanixxx.net/

30 February 27, 2014 at 4:31 am Thumb up 1 Thumb down 0

Hello There. I discovered your Leo Giamani weblog using msn.
That is a very well written article. I will make
sure to bookmark it and return to learn more of your useful information.

Thanks for the post. I will definitely comeback.

Reply

Bebe

31 March 27, 2014 at 12:34 pm Thumb up 0 Thumb down 0

Hi there it’s me, I am also visiting this site daily,
this web site is in fact good and the viewers are truly sharing nice thoughts.

Reply

Aasim Awan

32 April 4, 2014 at 3:31 am Thumb up 0 Thumb down 0

i have tried following on one of my production db ip and get following errors
C:\>qwinsta /server:10.10.10.206
Error 5 getting sessionnames
Error [5]:Access is denied.

C:\>query session /server:10.10.10.206
Error 5 getting sessionnames
Error [5]:Access is denied.

please provide help regarding this on my email

Reply

Leave a Comment

Previous post:

Next post: