Export all mailboxes' contacts to CSV

JulioQc picture JulioQc · Sep 8, 2016 · Viewed 7.4k times · Source

Is there a way to export all the contacts for each mailboxes in Exchange 2010 to a format easy to import to MS SQL? (i.e. CSV)

So far I got this working but a PST format is absolutely pointless:

foreach ($i in (Get-Mailbox)) { New-MailboxExportRequest -Mailbox $i -FilePath “\\computer\c$\pst\$($i.Alias).pst” -IncludeFolders “#Contacts#” -ExcludeDumpster}

The objective is to automate the task so we can run it each week or so.