Export AD Audit details to CSV
- Published on
- -1 mins read
- Authors
- Name
- David Galiata
- @neoslashnet
Very useful script I wrote to generate a .csv that shows valuable information from Active Directory.
$OutputPath = "c:\\support\\users.csv" $Year = "2019" $filename = "$($Year)\_users.csv" $YearUsers = Get-ADUser -Filter {(Enabled -eq "True")} -Properties created, lastlogondate,passwordlastset,passwordneverexpires $YearUsers | select name, samaccountname, created,lastlogondate,passwordlastset,passwordneverexpires |
Export-Csv -Path $OutputPath$filename -NoTypeInformation -Force