Find Inactive Users in Active Directory

By | 2022-08-25

Search for people who haven’t logged on to a domain in the past 180 days.

$180days = (get-date).adddays(-180)
get-aduser -filter * -properties lastlogondate | sort -property lastlogondate | Where-Object { $_.lastlogondate -le $180days } | export-csv c:\temp\inactiveUsers.csv

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.