How to remotely see what users are logged into Windows 7 or Vista
Solution 1:
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.
Solution 2:
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]
Solution 3:
Use this command:
wmic /node:"servername or ip address" computersystem get username
Solution 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.
Solution 5:
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.