PsLoggedOn – Windows CMD Command
See who is logged onto a computer, either locally or remotely
Syntax
psloggedon [- ] [-l] [-x] [\\computer | username]
Options:
computer The computer on which the process is running. Default=local system
-l Show only local logons instead of both local and network resource logons.
-x Don’t show logon times.
username Search the network for computers to which that user is loggedon.
-accepteula Suppress the display of the license dialog.
- Help, display all options and units of measurement used.
PsLoggedOn’s definition of a locally logged-on user is one that has their profile loaded into the Registry. If no one is currently logged on, PsLoggedOn will return the last logged on user.
Note that PsLoggedOn will show you as logged on via resource share to remote computers that you query because a logon is required for PsLoggedOn to access the Registry of a remote system.
When launched for the first time, PsLoggedOn will create the regkey
HKCU\Software\Sysinternals\PsLoggedOn\EulaAccepted=0x01
Examples:
List all processes running on \\workstationF4T:
pslist \\workstationF4T
WhoIsLoggedOnWhere.cmd - script to list all workstations