Find Last Logon Date and Time for Local User Accounts in Windows

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.



3 thoughts on “Find Last Logon Date and Time for Local User Accounts in Windows

  1. 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?

Leave a Comment