How to check who is currently logged on to windows workstation from command line?

Environment is in domain, server is Windows Server 2003, workstations have Vista and XP installed.
I need the way to check remotely who is currently logged on workstation, preferably from some simple command line and without sysinternals or third party programs.

Thanks


Solution 1:

This was the original source but that is now 404 :

They suggested using the (Windows Management Interface Command) WMIC which available on windows :

WMIC /NODE: xxx.xxx.xxx.xxx COMPUTERSYSTEM GET USERNAME 

Will return the username currently logged into xxx.xxx.xxx.xxx, or

WMIC /NODE: "workstation_name" COMPUTERSYSTEM GET USERNAME 

will return the username currently logged into "workstation_name"

UPDATE: This should working on Windows 10 too - if you are an admin on the remote machine.

Solution 2:

Sorry, did not notice you do not want to use Sysinternals.
That is now a Microsoft technet tool, any specific reason to not use it?
I have preferred Sysinternals over other third party tools before Mark Russinovich moved into Microsoft.


The Microsoft Sysinternals Suite has a tool called Psloggedon,

psloggedon.exe -l

There is also NBTSTAT,

nbtstat -a NetBIOS-Computer-NAme