20

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

1
  • 5
    This question is fine for SuperUser.
    – random
    Aug 20, 2009 at 14:03

6 Answers 6

20

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

2
  • 8
    you have to add /domain to the command, if you're on a domain...
    – fretje
    Aug 20, 2009 at 14:12
  • ahah! in that case, my check of the local user worked perfectly. cheers
    – gbjbaanb
    Aug 20, 2009 at 14:21
14

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

1
  • 1
    The simplest thing I found here, and that works! Thanks. Stuns me that this isn't more easily available on the start menu somewhere. Sep 28, 2020 at 5:05
3

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

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.

3
  • Good idea, though it requires Administrative rights (or authorization to change such settings).
    – Gnoupi
    Aug 20, 2009 at 14:17
  • This is also not a solution if the OP wants to know NOW when he last logged on, before he configured auditing.
    – fretje
    Aug 20, 2009 at 14:20
  • I have a Dutch Windows, so I can't search on "Local Security Policy", and when I launch "secpol.msc", it is not found. I have a Windows-10 Home Edition. Is this not covered here?
    – Dominique
    Mar 3, 2021 at 12:29
-1

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

2
  • 3
    And more precisely, what to check ? Because the event logs tells a lot of things.
    – Gnoupi
    Aug 20, 2009 at 14:11
  • unfortunately even MS breaks older links nowadays without any remorse Mar 26, 2021 at 7:22
-1

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

3
  • 3
    It's better to post more than just the link (meta.stackexchange.com/questions/15625/…)
    – fretje
    Aug 20, 2009 at 14:03
  • 4
    I don't personally mind a link-answer, as long as I don't have to click it to understand what it is. "Does this work for you" doesn't tell me anything.
    – Sampson
    Aug 20, 2009 at 14:07
  • 1
    especially since links like that tend to eventually break Mar 26, 2021 at 7:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .