How to know if someone else is logged to a remote shared PC?

6,658

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

Share:
6,658

Related videos on Youtube

AhmedWas
Author by

AhmedWas

Updated on September 18, 2022

Comments

  • AhmedWas
    AhmedWas over 1 year

    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

    • Ramhound
      Ramhound about 8 years
      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.
    • AhmedWas
      AhmedWas about 8 years
      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.
    • Ramhound
      Ramhound about 8 years
      If somebody is logged in it will notify you of that fact.
  • AhmedWas
    AhmedWas about 8 years
    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.
  • dxiv
    dxiv about 8 years
    "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.