Saturday, February 3, 2018

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


Answer




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.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...