Finding username of someone who's logged into a laptop on the network

Soldato
Joined
30 Apr 2006
Posts
18,029
Location
London
Hi All

I need to track down an assest and i know the hostname (and hence the IP) of the laptop in question. I can ping it so it's currently on the network in one of our offices. Is there an easy why (or command in cmd) to find out whos logged into that machine right now? I just need the username and the i can take the rest from there.

My google-fu is weak on this one.
 
Windows Management Instrumentation of course!

On a command prompt:

WMIC /Node:"FQDNHostName" ComputerSystem Get UserName

Change FQDNHostName to the fully qualified domain name for the PC in question.

EG PC01.domain.local

Job done

WMI is always the best to use and can return pretty much any information about a system you want. Serial Number, Model, Running Processes, Installed Software, Registry key values etc etc You can run it from CLI, Script it......whatever really :)
 
Last edited:
Windows Management Instrumentation of course!

WMIC /Node:"FQDNHostName" ComputerSystem Get UserName

Change FQDNHostName to the fully qualified domain name for the PC in question.

EG PC01.domain.local

Job done

Thats quite a handy command. I normally use Psloggedon from sysinternals suite.
 
Back
Top Bottom