Quick and dirty PowerShell snippet to export all Active Directory users with these selected attributes into CSV file where the attributes will be headers of the columns.
1 2 3 4 | Import-Module ActiveDirectory Get-ADUser -Filter * -Properties * | Select-Object SamAccountName,GivenName,Surname,DisplayName,Title,Manager,EmployeeID | Export-CSV -Path C:\Outputs\AD2Users.csv -NoTypeInformation -Encoding UTF8 |
Once you execute the script, it will create the AD2Users.csv file in same directory as is the script. You can Specify your path by adding correct export path such as [ C:\Outputs\AD2Users.csv ] or something similar. As well you can add or remove attributes you require for your export and needs.