Show last user logon in AD

Scripts

A colleague complained that he needed to remove all users from AD even with the last logon. I googled for a while before it finally met my expectations.

powershell – File last_user_logon_ad.ps1 – html

will output to html, sorted from newest to top.

-csv will do CSV 🙂

After studying the file, it is possible to enter a specific OU as a parameter, if necessary, the number of days from which inactivity should be counted, ..

And another colleague said he wanted to see when the account was created and last used…