Hello I need assistance in finding out users' last logon on a specific sub ou. I used this PS command that I got here in the forum, but this only provides the parent ou not the child ou:
Get-ADUser -filter * -SearchBase 'ou=Offices,DC=contoso,DC=com' -Properties LastLogonTimeStamp | Select sAmAccountName,@{label="LastLogonTimeStamp";Expression={if($.LastLogonTimeStamp){[datetime]::FromFileTime([Int64]$.LastLogonTimeStamp)} Else {"Never"}}}
I need the sub ou members. I would really appreciate if someone could assist. Thank you.