query user /server:x.x.x.x
listará o (s) usuário (s) conectado (s).
Quanto ao erro access denied
, verifique se as contas de usuário têm os direitos necessários na máquina remota. De Consulta ao usuário / 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