Read time 5 minutes

Organizations often have hundreds of business contacts that they want to add to the global address list of Exchange Online. One reason to add existing contacts to Exchange Online is that users will be able to access any of these contacts easily via the shared address book. Also, you can add external contacts as members of distribution groups. External contacts can be imported to Exchange Online in bulk using Exchange Online PowerShell and a CSV file. Let’s see how this process works.

This process consists of three steps, which include creating a CSV file, creating external contacts using PowerShell, and then adding information to the properties of external contacts.

Creating a CSV file

The first step involves creating a CSV file that will contain information about the external contacts that you want to move to Exchange Online.

  1. Copy and paste the below text to Notepad and enter the details of external contacts, and then save it with extension .csv; for example, Externalcontacts.csv

    Note: This text lists the properties of contacts that will be used while importing to Exchange Online. After adding this list, you can enter the details of your external contacts.

  2. You can open the CSV in Microsoft Excel as it will be easier for you to edit the CSV with MS Excel.
  3. Now, create a row for every external contact that you want to import to Exchange.
    Note: The following properties must be populated in the CSV file: ExternalEmailAddress, Name, FirstName, and LastName because the PowerShell command will use the values of these properties to create contacts.
Creating contacts with PowerShell

After creating a CSV file, you can use Exchange PowerShell cmdlets to import external contacts to Exchange Online.

  1. Connect to Exchange Online PowerShell using Office 365 global administrator account.
  2. After connecting to PowerShell, navigate to the location where the CSV file is saved..
  3. Now, use the below command in PowerShell to create external contacts..
    Import-Csv .\ExternalContacts.csv|%{New-MailContact -Name $_.Name -DisplayName $_.Name -ExternalEmailAddress
    $_.ExternalEmailAddress -FirstName $_.FirstName -LastName $_.LastName}

    Note: Once the command is finished, PowerShell will display a list of new contacts that are created.

  4. You can view the new external contacts by visiting the Exchange Admin Center > Recipients > Contacts or by visiting the Microsoft 365 Admin Center>Users>Contacts.
  5. If you’re unable to view the contacts, then click Refresh to update the list and check the contacts that are imported to Exchange Online.
  6. The imported contacts will be visible in the shared address book in Outlook and Outlook Web app..

Adding information to the external contacts

Performing the above step will create external contacts, but you’ll have to enter the contact information from the cells in the CSV file. It happens because while creating external contacts, only the required properties are occupied. So, if all the information is not populated in the contacts from CSV, then you’ll have to follow the below steps to do that.

  1. Connect to Exchange Online PowerShell from your Exchange Online administrator credentials.
  2. Go to the location where the CSV file is saved. For example, C:\users\administrator\desktop. The Excel sheet with the information looks like this.Excel sheet with the information
  3. Now, run the below command in the PowerShell to add properties to the external contacts from the CSV file.
    $Contacts = Import-CSV .\ExternalContacts.csv
    $contacts | ForEach {Set-Contact $_.Name -StreetAddress $_.StreetAddress -City $_.City -StateorProvince $_.StateorProvince -PostalCode $_.PostalCode
    -Phone $_.Phone -MobilePhone $_.MobilePhone -Pager $_.Pager -HomePhone $_.HomePhone -Company $_.Company -Title $_.Title -OtherTelephone
    $_.OtherTelephone -Department $_.Department -Fax $_.Fax -Initials $_.Initials -Notes $_.Notes -Office $_.Office -Manager $_.Manager}
  4. The process will take some time to update the contact information depending upon how many contacts you upload.
  5. You can verify whether the properties are added to the contacts or by visiting Recipients > Contacts in the EAC.
  6. To check any contact’s properties, click Edit on any contact.
    You can also check the contact’s properties in the address book of Outlook and Outlook web app.

So, following the above steps, you can add new external contacts in Exchange Online. But sometimes the manual process doesn’t work properly, and users often get errors while migrating external contacts to Exchange Online. And, of course, the process seems long and technical and so not suitable for all users. Therefore, they need a solution that provides flawless migration of contacts to Exchange Online.

Third party tool for flawless migration of contacts to Exchange Online

Kernel Import PST to Office 365 is an effective tool specially designed to migrate Exchange and Office 365 mailboxes from one server to another. It is designed with innovative algorithms that allow users to bulk import contacts to Exchange Online quickly. Apart from contacts, users can also import mailboxes, calendar, tasks, and other items from a CSV or PST file to Exchange Online and Exchange Server.

Final words

We learned the native way to move external contacts to Office 365 using a CSV file. The process is quite lengthy and difficult to follow. So, a smart, professional tool to import external contacts has been introduced. This tool can be handy in all types of Office 365 migrations.

Kernel Import PST to Office 365