How to Export AD Users to CSV File

The below PowerShell command should work

Get-ADUser -Filter * -SearchBase "OU=Research,OU=Users,DC=ad,DC=contoso,DC=com" -Properties * | Select-Object name | export-csv -path c:\temp\userexport.csv

You can also do the same task using AD GUI

  • Open AD, Click on Filter Button.
59114-filter.jpg
  • Perform a Custom filter for Organization Unit.
59211-ad1.png
  • Click on the Export button
59212-export.jpg
  • Select CSV file extension
59185-csv.jpg

Ref: https://docs.microsoft.com/en-us/answers/questions/239938/export-ad-users-to-csv-file.html