How can I tell when I logged into Windows?
Sebastian Wright
On UNIX I can tell when I logged in and out of my workstation with the last command. Is there a way to get the same information on my Windows workstation?
I notice that Cygwin has a last command, but wtmp doesn't seem to be populated. Is there a way to get last working with Cygwin?
(If this can only be done programmatically, should the question be on StackOverflow?)
16 Answers
You can try "net user < username >" - one of the many results will be the 'Last logon' time (note: I've only tried this on a domain workstation, not a standalone one, so your results may be slightly different).
2Open Command Prompt. at prompt, type 'quser' should display your logon username and time along with some other data.
1I see a lot of dancing around the event log answer, but not the exact answer, so I will give it.
- Go into the Event Viewer
- Expand Windows Logs (under Event Viewer)
- Choose Security (under Windows Logs)
- View the Task Category column for logons
- Click on a logon row and view the details to see if it is the user you are expecting.
If you go to Control Panel > Administrative Tools > Local Security Policy, there is a bunch of audits you can set up including Logon and Logoff.
After setting this up (and performing a restart), all the details should appear in the event log.
3you can check the windows events logs for that!
2Does this work for you: Last login time in VBScript?
3