How to export the Mailbox information to .CSV so I can import it as mail contact

Hi All,

I need to export the Exchange server mailbox details, so I can generate the .CSV file to import as Mail-Contact in my new Exchange Server OnPremise using the script below:

Import-Csv "C:\TEMP\contact2.csv" | foreach {Set-Contact $_.externalemailaddress -Name $ -FirstName $_.firstname -LastName $_.lastname -StreetAddress $_.streetaddress -StateOrProvince $_.province -City $ -PostalCode $_.postalcode -MobilePhone $ -Phone $_.workphone -HomePhone $_.homephone -Company $ -Title $_.title -Department $_.department -CountryOrRegion $_.countryorregion -Fax $_.fax -Notes $_.notes -Office $}


Any help would be greatly appreciated.


There a bunch of articles on this type of use case.

What have you searched for?

Search string ‘export exchange mailbox to csv’

Why have you tried?
Search string ‘export exchange mailbox to csv’

PowerShell scripts to Migrate Exchange Mailbox and Distribution Group Send As, Full Access and Send On Behalf Permissions into a CSV file–Part I : Export Script

How to Export Exchange Contacts to PST or CSV File Formats?

How to export a list of mailboxes to a CSV file

or use purpose built tools

Move mailboxes using MigrationWiz

Export Active Directory mailboxes and create MigrationWiz import file