Exporting AD users with email

By | 12 October, 2016

To export all active directory users and their email addresses  from a certain OU (ie. finance) to a comma seperated file, use the following PowerShell command

Get-ADUser -filter * -SearchBase 'OU=Finance,DC=contoso,DC=com' -properties Emailaddress | select-object Name, emailaddress | Export-Csv c:\users.csv

Leave a Reply

Your email address will not be published. Required fields are marked *