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

administratorcommand lineremote desktopsessionwindows 7

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

Best Answer

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