Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
5  
This question is fine for SuperUser. –  random Aug 20 '09 at 14:03

4 Answers 4

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

share|improve this answer
3  
It's better to post more than just the link (meta.stackexchange.com/questions/15625/…) –  fretje Aug 20 '09 at 14:03
3  
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. –  Jonathan Sampson Aug 20 '09 at 14:07

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

share|improve this answer
1  
you have to add /domain to the command, if you're on a domain... –  fretje Aug 20 '09 at 14:12
    
ahah! in that case, my check of the local user worked perfectly. cheers –  gbjbaanb Aug 20 '09 at 14:21

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

share|improve this answer
3  
And more precisely, what to check ? Because the event logs tells a lot of things. –  Gnoupi Aug 20 '09 at 14:11

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.

share|improve this answer
    
Good idea, though it requires Administrative rights (or authorization to change such settings). –  Gnoupi Aug 20 '09 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 '09 at 14:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.