Skip to content

Instantly share code, notes, and snippets.

@martin9700
Created June 28, 2014 18:08
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save martin9700/fb4bba20ad5bbb9526a2 to your computer and use it in GitHub Desktop.
$Report = $Users.Values | Select Name,SamAccountName,@{Name="Last Logon Date";Expression={ If ($_.lastLogon) { [datetime]::FromFileTime($_.lastLogon) } Else { "None" }}}
$Report | Export-CSV C:\Scripts\LastLogonReport.csv -NoTypeInformation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment