Determine user logged into a computer via command line

Many network utilities or appliances identify computers by hostname or IP address (obviously). But often it is helpful to know the username of the person actually using the computer.

The fastest way I've found to do this is to use PSLoggedOn.exe which is part of the sysinternals suite (

The command is also very simple: psloggedon.exe \\{Fully-Qualified Hostname or IP address}

Assuming you're on the same LAN and are using an Active Directory domain, this command should quickly return the name of the user that is logged on and the time they logged on.