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)?

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

3 Answers

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

rwinsta /server:SERVERNAME SESSIONID
link|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
feedback
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.

link|improve this answer
feedback

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 :)

link|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
feedback

Your Answer

 
or
required, but never shown

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