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

I've used quser before to query users on the local server. I noticed today that it has an option for querying a remote server. However, when I tried it, I keep getting the following error:

C:\Users\nimmylebby>quser administrator /SERVER:remote_server
Error 0x00000005 enumerating sessionnames
Error [5]:Access is denied.

I'm assuming it's because I do not provide a password? But I do not see an option to provide password. Here is the help doc:

C:\Users\nimmylebby>quser /?
Display information about users logged on to the system.

QUERY USER [username | sessionname | sessionid] [/SERVER:servername]

  username            Identifies the username.
  sessionname         Identifies the session named sessionname.
  sessionid           Identifies the session with ID sessionid.
  /SERVER:servername  The server to be queried (default is current).

Perhaps I'm misunderstanding the quser command? Is there a more appropriate command for this?

share|improve this question
possible duplicate of How to boot other Remote Desktop users – ThatGraemeGuy Oct 22 '10 at 21:51
Although this question is about how to use quser, that question is definitely helpful. Thank you Graeme! +1 – Belmin Fernandez Oct 23 '10 at 12:03
up vote 1 down vote accepted

Are you querying to find out if the user named administrator has a session on the remote server?

Is the account under which you're running quser a domain admin or a local admin of the remote server?

share|improve this answer
Was not aware that the PC had to be part of the domain. The help text does not describe that. Thanks. – Belmin Fernandez Oct 23 '10 at 22:22

Can you use runas?

runas /user:DOMAIN\user "quser /SERVER:servername"

Where DOMAIN\user has admin rights on the target server?

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.