How to query what users are logged on to a remote server's Terminal Services

3

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?

windows
command-line-interface
windows-terminal-services
asked on Server Fault Oct 22, 2010 by Belmin Fernandez

2 Answers

1

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?

answered on Server Fault Oct 23, 2010 by joeqwerty
1

Can you use runas?

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

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

answered on Server Fault Oct 23, 2010 by dunxd

User contributions licensed under CC BY-SA 3.0