Create AD Query for Users Creation Date, Department, Disabled/Enabled
Posted on 2013-01-23
I need to create either an AD query or Powershell script that can export to CSV showing all users in following format:
I know with the following command I can see User name and Creation date but if someone could add the required entries for the other items that would be awesome!
Get-ADUser -Filter * -Properties whenCreated -SearchBase "DC=ad,DC=local" |
Select-Object SamAccountName,whenCreated |
Export-Csv "C:\myscripts\ADusers.csv" –NoTypeInformation