For many reasons, we sometimes need to Export active directory users to CSV.
We can perform this operation in some ways, the two best ways are the Dsquery command and the PowerShell cmdlet Get-ADUser.
To use DSquery command to export users to CSV, we should use samAccountName and Name while Modifying the filter based on information needed as follow:
Dsquery * -filter “&(objectClass=User)(objectCategory=Person)” –attr samAccountName Name >>MyUsers.csv
To use Get-ADUser command:
Get-ADUser -Filter * -SearchBase “ou=OU,dc=Gmalaya,dc=Local” -Properties * | Export-Csv “d:\MyUsers.csv”
Media & Video specialist with Adobe products.
Founded Gmalaya at 2008.
Latest posts by Alon Yardeni (see all)
- exchange 2010 no-reply email - January 27, 2014
- Personalize Symantec endpoint protection client install - January 22, 2014
- Outlook 2013 crash configuring exchange account - January 17, 2014