Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Time to time I can't login to my Windows Server 2003 because there are to many open sessions. Is it possible to close them remotely(without physical contact in server room)?

share|improve this question
Have you considered turning on the "only one session per user" setting? – Harry Johnston Oct 8 '11 at 0:33

You can do it using the qwinsta and rwinsta command line tool:

qwinsta /server:SERVERNAME

You will get a list of the Remote Sessions in the command window. Make sure the account you're logged in on your client computer has admin rights on the server. You can also use the server's IP address instead of the server's name.

You need the session ID of the RDP session in order to disconnect a user. This command shows you all sessions

share|improve this answer
It shows error Error opening Terminal server IP Error [5]:Access is denied. when i try to execute qwinsta /SERVER:IP – yura Oct 7 '11 at 12:15
@yura You'll have to use it with a user which has admin rights on the server. If you have to servers you could connect as admin to one server and try it from there. – splattne Oct 7 '11 at 12:43
But how can I connect to server then? If it print to many session are open? I was think that i should write this command from my local windows machine, but on this machine user of course different from admin on server... – yura Oct 7 '11 at 14:33
@yura Then use a runas to do it as a user which does have those admin rights. – Shane Madden Oct 7 '11 at 15:14
In terminal services the admin session will have an ID of '0'. There can only ever be one of these, if someone was to log in with the same credentials they would steal your session. If you run command prompt and then runas /user:SERVER\USERNAME /password:PASSWORD you should be able to run the commands listed above perfectly. – Stephen Murby Jul 10 '12 at 9:34
up vote 1 down vote accepted

You can connect to server with command mstsc -v:IP /admin. It is works even when there are to many open sessions.

share|improve this answer

I used PsTools:

psshutdown -o -f \\servername

  • -o logs off the console session
  • -f forces open apps to close
share|improve this answer

I think you can connect as administrator and disconnect all the other sessions.

If the above if true this might be automated through a script(that connects as admin and performs the desired actions).

Hope it helps :)

share|improve this answer
We always use same user which already belongs to administrator group. And now we can't login to Server with this administrator user... Are we talking about same administrator user? – yura Oct 7 '11 at 11:22

Open up the Terminal Services Management console on a domain member computer and connect to the system in question.

This will list all sessions on the remote machine, which you can then reset (kill), or log off individually.

share|improve this answer

If you have the proper administrative tools set up, there is a tool you can use to manage remote sessions. Hit your start key and type Remote Desktop Services Manager into the search box. It should find an entry of the same name that you can run. If you don't see that entry, try connecting to a Windows Server system and looking there.

When the window opens, there will be an area on the left side that says, "Remote Desktop Services Manager", with a computer (probably your computer) listed underneath. Right click on the Remote Desktop Services Manager option and choose "Connect to Computer". A window will open where you can choose "Another Computer" and enter the computer name that you are unable to reach. Now the name of the locked computer will show in the list. Click on it, the section to the right will show information about that computer, including a tab that will show any open sessions. From here, you can right-click on a session and choose to disconnect, logoff, or reset it. Do that, and you will be able to connect to the computer via remote desktop again.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.