Using ‘Net user’ command we can find the last login time of a user. The exact command is given below.
net user username | findstr /B /C:”Last logon”
Example:
To find the last login time of the computer administrator
C:\> net user administrator | findstr /B /C:"Last logon" Last logon 6/30/2010 10:02 AM C:>
{ 4 comments… read them below or add one }
How to find the last user logged into the machine?
IS there any way to find this from command line?
I think from event log we can find the last logged in user name. I do not know of any way to know this from command line.
I run CMD with Admin right. But I receive MSG: “FINDSTR: Can not open logon”?
May you explain me?
Thank you.
I think you have executed something like below
net user administrator | findstr /B /C:Last logon
You may have missed double quotes around ‘Last Logon’. Run the command “net user administrator | findstr /B /C:”Last logon”. It would print the last login time.