In response to a script request recently from one of our readers, here is a VBScript that I came up with, that displays last logon date/time details for each local user account in a computer.

[Download lastlogon.vbs]

This script uses WMI’s Win32_UserAccount class to get the list of local user account information, queries the LastLogin property for each local user account and displays it in a message box.

If you need to know the last logon information at every startup, place the script into your Startup folder. To open the Startup folder of your user profile, press WinKey + R to access the Run dialog, type "shell:startup" (without quotes) and press {ENTER}. Drag the VBScript file to the Startup folder.


Email SubscriptionPrefer an E-mail subscription?

Enter your email address:

Delivered by FeedBurner

3 Comments

  1. said this on Monday, May 20th 2013 10:25 pm

    This script is fantastic, however, it is not pulling all of my users. I have a list of about 30 local users, but about 9 are not being listed. Any ideas on how I can get the others to populate?

  2. Rajsekhar
    said this on Tuesday, October 18th 2011 11:50 am

    This script is awesome.. hope it doesnot effect the pc

  3. Fleet Command
    said this on Monday, August 30th 2010 4:58 pm

    Thanks for the Shell:Startup note. I didn’t know that…

Leave a Reply