Hi
I am currently doing a full audit on our AD environment and need reporting back all user accounts that are live within each site OU we have, that meet the following criteria
-Not Disabled
-Not Expired
-User has logged on in the past 90 days
So far i have the following but only shows users that have accounts Enabled in the SITEA ou, i am struggling to add the logged on in last 90 days and account has not expired syntax
Get-ADUser -SearchBase "OU=SITEA,DC=MY,DC=COMPANY,DC=CO,DC=UK" -Filter * |where { $_.enabled -eq $false}| Sort-Object name | select name | Export-Csv 'c:\scripts\sitea.csv'
Any help would be appreciated
Barrie