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.