How to get last logon time for local users in Windows

Run the following powershell command. You can even pipe it to a text file

 

$([ADSI]”WinNT://$env:COMPUTERNAME”).Children | where {$_.SchemaClassName -eq ‘user’} | ft name,lastlogin

Leave a Reply

Your email address will not be published. Required fields are marked *