October 2021
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Ever needed to output the last login Timestamp of a particular Active Directory OU to a file?

I needed to do this after inheriting a new secondary school & when upgrading 100s of laptops to Windows 10 and not knowing which ones had recently been logged into!

get-adcomputer -Properties * -SearchBase "OU DISTINGUISHED PATH" -SearchScope Subtree -Filter * | select Name, LastLogonDate | Out-File C:\out\out.txt