Is there a quick way to find out which servers I'm currently remoted in to? I'm running Windows XP on my computer, and I've closed all my rdp windows but didn't log off, and I'd like to know if there is a way for me to find out all the servers that I'm currently rdp'ed to.


  • are they on domain? – Andrew Smith Jun 26 '12 at 19:50
  • yes, they are on a domain. – Chinesinho Jun 26 '12 at 20:03
netstat -an |find "3389"

This shows all open connections, and then filters to only show matches for 3389 (the normal RDP port). This shows the other endpoint (the server you're connected to). This will also show any machines that have 3389 connected to you, as well.

/Edit - I think this might not be the answer you're looking for? You want to know all machines that you're no longer connected to, but have a disconnected session open on? You'll have to query each machine - I hope you're in a domain.

So - get a list of all servers in your domain (and/or whatever machines might be in question.) Put it in a file called servers.txt. Run :

for /f %s in (servers.txt) do (echo %s & qwinsta /server:%s )

  • thanks for response, but yea...I'm looking for machines that I'm "no longer" connected to, but have a disconnected session open. I'll have to query each machine in the domain? Because I don't remember what machine(s) I'm connected to...that's why I think what I'm trying to do will come in quite handy. – Chinesinho Jun 26 '12 at 20:07
  • actually that command will only show you current open rdp connections - not what machines you are logged into – Jim B Jun 26 '12 at 20:14
  • 1
    @JimB - you'll see my edit shows that I figured that out from a re-reading of his question :-) – mfinni Jun 26 '12 at 20:16
  • @mfinni ahh yes - amazing what refreshing the webpage will tell you. – Jim B Jun 26 '12 at 20:18

the simplest way is to use Query user /server:servername This command will give you a list of sessions that the currently logged on user has on a given servername. This could be used in a batch or powershell script for automation.


http://code.google.com/p/cassia/ - in the package there is sessioninfo.exe, you can try this. Basically you can go thru all remote desktop servers, and list each session state, like connected (connection established), disconnected (connection closed). You can also redirect session to the console etc.

  • Ive used the cassia stuff before, it works well. A lot of it is replicated in the official RDS Powershell modules now though. – Mark Henderson Jun 26 '12 at 22:41

Assuming you have the appropriate user rights on the TS servers, you can install the Windows Server 2003 Administration Tools Pack and use Terminal Services Manager to find all of your sessions.




You might give this guy a try:


It manages a number of RDP sessions in one tool, and I believe it indicate which ones you've simply "closed"

  • It does not - although I do like using it, it doesn't have this feature. – mfinni Jun 26 '12 at 21:25
  • Ahh ok, glad you like it, sorry it didn't do what you were looking for. – Univ426 Jun 27 '12 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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