AD Query User by Last Logon Date [Value=LastLogonTimeStamp]
Get-ADUser -Filter * -SearchBase “ou=uyeler,dc=guler,dc=com” -ResultPageSize 0 -Prop CN,lastLogonTimestamp | Select CN,@{n=”lastLogonTimestamp”;e={[datetime]::FromFileTime($_.lastLogonTimestamp)}} | Export-CSV c:\pw_last_logon_users.csv -NoTypeInformation
This post is licensed under CC BY 4.0 by the author.