0

In the company I work for, there are some shared PCs where people can log to remotely. It's boring to ask first who is logged in before login to it yourself, just not to disrupt others work.

With searching, I fount the following two commands from cmd to list the logged users at the moment: qwinsta /server:x.x.x.x or query session /server:x.x.x.x but I keep getting the following error:

Error 5 getting sessionnames
Error [5]:Access is denied.

Then I looked for a solution, but all leads to something like this. I've tried, but that didn't help as well :(

Info: local and remote PCs are both Win7 & and all team memebers login as an Admin with the same account

3
  • Only a single user can be logged into Windows 7. You can switch between users, but only one of those users, will be actually the active user. When a remote user logs into a PC the screen will be locked and indicate who is logged into the machine.
    – Ramhound
    Commented Feb 4, 2016 at 16:35
  • What do you mean by "indicate who is logged into the machine". This never happens. You just go to Windows remote desktop connection, type the IP address. Then it asks for username and password and you connect without any indication of who was already connected before you login.
    – AhmedWas
    Commented Feb 5, 2016 at 7:26
  • If somebody is logged in it will notify you of that fact.
    – Ramhound
    Commented Feb 5, 2016 at 12:03

1 Answer 1

1

query user /server:x.x.x.x will list the logged on user(s).

As for the access denied error, make sure the user accounts have the necessary rights on the remote machine. From Query User / QUSER:

A user can always query the session to which the user is currently logged on. To query other sessions, the user must have Query Information special access permission.

The User Access permission type grants the following special permissions: Query Information, Logon, and Connect. These special permissions allow a user to: Log on to a session on the terminal server. Query information about a session. Send messages to other user sessions. Connect to another session.

Permissions are set under:

Terminal Services Configuration | Connections | Properties | Permissions | Advanced | Permissions

2
  • Okay, I have admin rights on my local machine and on the remote machine. But, of course, I don't have admin rights on others local machines. If I understand you correctly.
    – AhmedWas
    Commented Feb 5, 2016 at 7:27
  • "Admin rights" is too generic, and not necessarily enough. What matters is for those specific user permissions to be enabled - on the remote machine. The other users' local machines settings don't matter.
    – dxiv
    Commented Feb 5, 2016 at 7:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .