bschelst/ January 5, 2017/ PowerShell/ 0 comments

Within Powershell you can also see when a LOCAL user was last logged in.
This can be done with the following one-liner:

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

example output:

 name                                                        lastlogin ----                                                        --------- {localadmin}                                                {28/09/2016 08:57:19} {nx}                                                        {05/01/2017 19:52:58} {Visitor}

 

 

 

Share this Post

Leave a Comment

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
*
*

ten − 6 =