23

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?)

skiphoppy
  • 2,833

6 Answers6

23

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).

gbjbaanb
  • 1,440
19

Open Command Prompt. at prompt, type 'quser' should display your logon username and time along with some other data.

Dave
  • 191
4

I see a lot of dancing around the event log answer, but not the exact answer, so I will give it.

  1. Go into the Event Viewer
  2. Expand Windows Logs (under Event Viewer)
  3. Choose Security (under Windows Logs)
  4. View the Task Category column for logons
  5. Click on a logon row and view the details to see if it is the user you are expecting.
3

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.

William Hilsum
  • 117,648
-1

Does this work for you: Last login time in VBScript?

Joey
  • 41,098
DrJekl
  • 401
-1

you can check the windows events logs http://support.microsoft.com/kb/308427 for that!