Exporting Exchange server mailbox information as .CSV so I can import.CSV as Mail-Contact?

Ask your Windows PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
ITEngineer
Posts: 145
Joined: Wed Oct 12, 2011 10:52 am

Exporting Exchange server mailbox information as .CSV so I can import.CSV as Mail-Contact?

Post by ITEngineer » Thu Feb 28, 2019 4:44 am

People,

I need to export the sister company Exchange Server mailbox attributes as .CSV, So I can run it on the new Exchange Server OnPremise using the script below:

Code: Select all

Import-Csv "C:\contacts.csv" | foreach {Set-Contact $_.externalemailaddress -Name $_.name -FirstName $_.firstname -LastName $_.lastname -StreetAddress $_.streetaddress -StateOrProvince $_.province -City $_.city -PostalCode $_.postalcode -MobilePhone $_.mobile -Phone $_.workphone -HomePhone $_.homephone -Company $_.company -Title $_.title -Department $_.department -CountryOrRegion $_.countryorregion -Fax $_.fax -Notes $_.notes -Office $_.office}
Any help would be greatly appreciated.

Thanks
/* IT Engineer */

User avatar
jvierra
Posts: 13733
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Exporting Exchange server mailbox information as .CSV so I can import.CSV as Mail-Contact?

Post by jvierra » Thu Feb 28, 2019 5:02 am

Just export the same attributes from the source.

Locked