Tag Archives: CSV

Adding Contacts to O365 with CSV files – KB10392210


Adding Contacts to Office 365 Exchange server

Customer requesting external contact to be added to the Exchange server and Setting up Distrabution groups

Download the Follow File and have the customer fill out the information for the Contacts needing to be added


It includes sample data, which you can delete. But don’t delete the first row. It contains all of the properties for the external contacts. Create a row for each contact that you want to import to Exchange Online. Populate as many of the cells as possible. This information will be displayed in the shared address book for each contact.

However, the following parameters are required to create an external contact and must be populated:

After the ontact has returned the needed file you can start to setup the new Distribution groups in O365

The Follow is the commands used to log in to the Servers PowerShell interface

$UserCredential = Get-Credential

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

Import-PSSession $Session

first command will only create the Contact without extended information

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

They command will update the Contacts on the system with the extended information

$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}

Used to add the new contacts to the Distribution lists

you will need to remove all but the users names from the CSV file and rename the Tab to Members

Import-CSV <path> | ForEach {Add-DistributionGroupMember -Identity <Distribution Group Name> -Member $_.members}