Powershell Script - Export all domain users to CSV format
In the following example the CSV will include only the field listed after select-object
Get-ADUser -Filter * -SearchBase 'OU=Users,OU=contoso,DC=com' -Properties * | Select-Object GivenName,Surname,enabled,LastLogonDate| Export-Csv C:\temp\users.csv