Add contacts in Office365 in bulk

Source: Internet
Author: User

In O365, the contact item does not provide an option for bulk import and requires one Add. When you need to add large quantities, it is a very painful thing!

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s2.51cto.com/wyfs02/m02/79/34/wkiol1algqgihla2aabwtcl83n8234.png "title=" 01.png "alt=" Wkiol1algqgihla2aabwtcl83n8234.png "/>

In fact, we can bulk import contacts using Windows PowerShell and CSV files. The following four steps are mainly divided into:

1. Prepare the CSV file.

2. Establish the connection between PowerShell and O365.

3. Use the PowerShell command to import the required information for a contact.

4. Use the PowerShell command to import additional information for the contact.


The first step is to prepare the CSV file

The template for the CSV file is already in the attachment (Externalcontacts.rar). The CSV template includes sample data (which contains all the properties of the external contact ) and can be deleted and modified at will, except for the first 5 required parameters, without deleting the first line. The imported information is displayed in the shared Address Book for each contact.

The following parameters are required:

    • Externalemailaddress

    • Name

    • FirstName

    • LastName

    • Alias


Step two, establish a connection between PowerShell and O365

Please refer to another blog post for details: http://321674.blog.51cto.com/311674/1731809


Step three, use the PowerShell command to import contacts.

first, import the underlying information (Externalemailaddress,name,firstname,lastname,alias ), use the following command:

Import-csv. \externalcontacts.csv | %{new-mailcontact-name $_. Name-externalemailaddress $_. Externalemailaddress-firstname $_. Firstname-lastname $_. Lastname-alias $_. Alias}


Fourth step, import other contact information (streetaddress,city, etc.)

external contacts are created, but do not contain information such as any organization. run the following command to import additional information:

1, $Contacts = import-csv. \externalcontacts.csv

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


The Ps:manager parameter may be problematic. If the csv file parameter is blank, an incorrect information is added to the manager item. If you don't need to specify a manager, remove the option.


You can now view the contacts you have just imported in the Web page.



This article is from the "Stanleytam" blog, make sure to keep this source http://321674.blog.51cto.com/311674/1733644

Add contacts in Office365 in bulk

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.