Create Contacts in O365 from CSV file

1d5fcedf-baf6-48f5-91e4-987ed7d64a8a

Introduction

This script allow you to create contacts in Exchange Online by using a CSV file as input. I made that script during a migration project from Exchange OnPremise to Exchange Online. You can download it here .

Inputs

  1. Exchange Online Admin credentials.
  2. A log file path, which will contains the potentials errors during the script execution, but also the succeful actions.
  3. A CSV file using ; as delimiter. The CSV file needs to looks like the following :

The first colums will contains the contact name, and the second column will contains the contact email adress.

Usage

  1. Open Windows PowerShell
  2. Run the Create-Contact.ps1
  3. Enter the Credential which is at least Exchange Online Administrator, then click OK.
  4. Enter your log file path, and your CSV contact list :
  5. Then click Enter to start the script.

 

Ouput

The log file, that you will specified will contains all the actions made by the script.

Output Exemple 1

In this exemple, i have specified a bad file path or name for my CSV file.

Output Exemple 2

In this exemple, and you have may be notice it, but I deliberately slipped an error for the second contact. The log file informs you that the first contact was successfully created, but not the second one, plus it store the exception message in order to help you to resolve this error.

 

Hoping that script will be useful for some of you.