17

I need to login to a remote Win7 or Vista computer but when I connect I get a Logon Message "Another user is currently logged on..." but it does not specify who.

I have a domain username with admin privileges on the computer, how can I see who is logged in?

Dave M
  • 4,494
  • 21
  • 30
  • 30
Ziplin
  • 485
  • 2
  • 4
  • 16

11 Answers11

17

You can use the commands listed here to manage Terminal Server connections. query session /server:<servername> is probably the first one you want.

These all require remote procedure call, which is part and parcel with CIFS/SMB (the IPC$ share). Check that the RPC service is enabled first. Second, you can't/shouldn't (depending on network configuration) run these services over anything but the local network. If you're trying to do this sort of management over the Internet, you should be using a VPN or some creative SSH tunneling.

Michael Lowman
  • 3,584
  • 19
  • 36
  • @Michael, `query` is not packaged for non-server Windows. Where can do download it? Or is there an alternative? – Pacerier Mar 20 '15 at 11:06
13

Use the eventvwr to remotely view the security log for the remote computer, and scroll through the security logs until you find a login event for the other user:

eventvwr [remote computer name without brackets]
Ziplin
  • 485
  • 2
  • 4
  • 16
5

Use this command:

wmic /node:"servername or ip address" computersystem get username
zero0
  • 1,407
  • 16
  • 14
Martyn Weber
  • 61
  • 1
  • 1
4

Use powershell, MUCH easier, already instealled, no 3rd party tool required:

$computername = 'SomeMachine-or-IP'

Get-WmiObject Win32_ComputerSystem -ComputerName $computername | Select-Object -ExpandProperty UserName

Note that this will always return the user logged on to the physical machine. It will not return terminal service user or users inside a virtual machine. You will need administrator privileges on the target machine. Get-WmiObject supports the -Credential parameter if you must authenticate as someone else.

Jordan W.
  • 1,403
  • 1
  • 13
  • 19
  • Very cool. I didn't specify, but it is a remote user who is blocking me from login. Good tip though, Jordan. Thanks! – Ziplin Jan 31 '11 at 16:06
4

Another easy way I find it to UNC connect to the C:\users folder and sort profile by date updated. Bam easy as.

Henry
  • 41
  • 1
3

You should be able to use Terminal Services Manager. If you don't have this on your machine, you can RDP into a server that has it (any server should) under Control Panel -> Administrative Tools -> Terminal Services Manager. Then, go to Actions and choose "Connect to Computer". That will list all active and inactive sessions and users.

Matt
  • 159
  • 2
  • 2
  • 10
  • 1
    This just comes back with "Unable to connect to server". Don't know if that's why this got down voted or not. – Ziplin Jan 31 '11 at 16:08
  • Yeah, I don't know either. I use this all the time to see who didn't log out and to see who is still in a server. – Matt Jan 31 '11 at 16:16
3

An easy way to do this would be to use PSLOGGEDON http://technet.microsoft.com/en-gb/sysinternals/bb897545.aspx

from CMD navigate to where you extract the file and run psloggedon \\machinename

OR

Without downloading any software use the following command from CMD

qwinsta /server:[NAME] or [IP]

trozz
  • 557
  • 2
  • 12
  • 2
    Weird, I get `Error[1722]:The RPC server is unavailable` for qwinsta – Ziplin Jan 31 '11 at 16:05
  • When you run which one? try seeing if Remote Procedure Call is enabled in the Services of the machine you are attempting to query, you can use MMC to connect to the remote machine and enable the service – trozz Jan 31 '11 at 16:15
2

Another option i've thought of recently - use PSExec and get the output of netstat on the remote computer. You can easily get the IPs or hostnames of any remotely connected computers.

Ziplin
  • 485
  • 2
  • 4
  • 16
2

We had an issue where no one could log on as the limit was reached, so we used Remote Desktop Services Manager. That allowed us to see who was RDP in and disconnect the user who forgot to log off.

-2

(gwmi -ComputerName [computername] -Class win32_computersystem).username

KYLE
  • 1
-3

Just login to the remote server by going to mstsc.exe /admin /v:servername you then connect to the admin console this one is never in use