powershell-inactive-ad-users
Powershell

Get a CSV file of users who haven’t logged in over 90 days with Powershell

As the title suggests, this script will query Active Directory and create a CSV file for you to review accounts that haven’t logged in in over 90 days. get-aduser -filter ‘enabled -eq $true’ -Properties lastlogondate | Where-object {$_.lastlogondate -lt (get-date).AddDays(-90)} | Export-csv C:\users\public\desktop\inactive_users.csv -NoTypeInformation -Force