Thoughts on Software

Find out who’s logged on to a Remote Desktop Session

with 7 comments

It’s a problem I’ve hit multiple times: I need to remote into a server to do some work but there are only a few sessions available and they’re all in use. I could ask someone if they can log off for a while but as it’s possibly one of a number of people this requires a bulk email. What I really need is a way to identify exactly who is logged onto that server so I can ask them if they can log off for a while …

After a fair amount of googling, I tracked down the query session command for Windows which will do exactly this. Here’s an example:

query session /server:[SERVERNAME]

where [SERVERNAME] is the name of the server you are trying to remote onto. So if we were trying to connect to a server named MyServer, we’d enter:

query session /server:MyServer

Here’s redacted example of the command line query in action

Redacted example of the query session command in action

Redacted example of the query session command in action

There’s a lot more to this command than just the /server switch and the command is covered in detail in a good tech article form Micrsoft available here:


My next post covers how to forcibly disconnect users from a session when necessary.



Written by andrewlocatelliwoodcock

September 13, 2012 at 21:41

7 Responses

Subscribe to comments with RSS.

  1. Hi there you have a fantastic blog over here! Thanks for sharing this interesting information for us! If you keep up the good work I’ll visit your website again. Thanks!


    September 20, 2012 at 22:16

  2. is excellent, good work!


    September 29, 2012 at 13:22

  3. I’ve read some good stuff here. Definitely worth bookmarking for revisiting.

    Dog Yoga

    September 30, 2012 at 20:53

  4. […] on from my last post on how to find out who is connected to a remote desktop session on  particular machine, there are […]

  5. Great post. I was checking constantly this blog and I am impressed!
    Extremely useful info specially the last part 🙂 I care for such info much.
    I was seeking this certain info for a long time.
    Thank you and good luck.


    December 5, 2012 at 01:16

  6. Finally, after browsing for some time,
    I found a site from where I was able to genuinely grab valuable details
    in regard to the studies and the knowledge that I want. There need
    to be more things like this on eggBlog


    May 27, 2013 at 11:01

Leave a Reply

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

You are commenting using your 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 )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: