How to find username on remote computer?

Try this:

wmic.exe /node:"IP-or-HostName" ComputerSystem Get UserName

Example:

wmic.exe /node:"172.28.1.100" ComputerSystem Get UserName

Output:

UserName
DOMAIN\User

(Yes, /node value must be quoted)


For Windows boxes get psLoggedOn. It tells you who is currently signed into the box via console/rdp and who is connected via network shares.

If you don't want to install an app, there is also the commands qwinsta and query session that you can run from the command line like this:

qwinsta /server:name_of_host or query session /server:name_of_host