Bulk exporting of External contacts to Office 365 Exchange online

The non-profit organization that I support uses a Google group account to host its members email address. The organization has hundreds of email addresses in this group account. As soon as the organization started using Office 365 it soon become apparent that it needed to import those email addresses into Exchange Online in bulk so that we can add these emails into a distribution group (DG) account.

How do you go about importing these external emails into Office 365 Exchange online?

  1. Go to Google Gmail account, export the email addresses and save as csv inside the c:\temp folder or wherever you like.
  2. Make sure the following fields have values inside the above-mentioned csv file:
    • ExternalEmailAddress
    • Name
    • FirstName
    • LastName
    • OtherTelephone
    • Manage
  3. Start windows PowerShell as admin and connect to your office 365 Exchange online tenant. You can connect to Office Exchange online using the below scripts. You will be asked to login and make sure you use your Office 365 admin account and password:

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic –AllowRedirection

Import-PSSession $Session


4. Next run the following command:

Import-Csv c:\temp\ExternalContacts.csv|%{New-MailContact -Name $_.Name -DisplayName $_.Name -ExternalEmailAddress $_.ExternalEmailAddress -FirstName $_.FirstName -LastName $_.LastName}

The assumption is you saved your csv file under the folder c:\temp

As you ca see below now you should see each external users being exported to Office 365 Exchange online.


5. Go to your Office 365 Exchange online admin center to check exported contacts

6. Click recipients from left navigation and then contacts from top tab. Now you see all your external contacts populated inside Office 365.