How to find username on remote computer?

156,228

Solution 1

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

Solution 2

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)

Solution 3

Check out MetaLAN

Share:
156,228
Stian Tofte
Author by

Stian Tofte

Updated on September 17, 2022

Comments

  • Stian Tofte
    Stian Tofte almost 2 years

    I have the IP addresses of some computers on my network. Is there any command line tool like PsExec, which can take the IP Address as input and find out the username of the currently logged in user? I can install stuff on my workstation, but not the others. I can also run Metasploit / NMap / any other such program on my workstation.

  • Stian Tofte
    Stian Tofte about 14 years
    Oh awesome, theres a PsTool for it. I feel stupid. Anyhow, do these PsTools work on the default Windows XP configuration, without requiring anything to be installed on the remote computer?
  • MikeJ
    MikeJ about 14 years
    Correct. Firewall or disabling WMI will get in the way but often the windows firewall even when on contains an exception for WMI.
  • Otiel
    Otiel over 9 years
    Worked for me. I needed to run cmd as domain Administrator or else I got an error "Access is denied".
  • robinCTS
    robinCTS almost 6 years
    Apparently you have two accounts: account one and account two. You might wish to utilise this Help Center tutorial and ask the Super User staff to merge the accounts.
  • chk.buddi
    chk.buddi about 4 years
    Above command gives ' Access denied' for me, Any idea?
  • carloswm85
    carloswm85 almost 3 years
    Can you explian how that software could be helpful in a situation like this one?