Import-ContactList

 

Applies to: Exchange Online

This cmdlet is available only in the cloud-based service.

Use the Import-ContactList cmdlet and a .csv file to import a user's mail contacts to a cloud-based mailbox. Users can use an email client to export their contacts to a .csv file that is formatted for Microsoft Office Outlook.

For information about the parameter sets in the Syntax section below, see Exchange cmdlet syntax.

Import-ContactList -CSV <SwitchParameter> -CSVData <Byte[]> -Identity <MailboxIdParameter> <COMMON PARAMETERS>

Import-ContactList -CSV <SwitchParameter> -CSVStream <Stream> -Identity <MailboxIdParameter> <COMMON PARAMETERS>

COMMON PARAMETERS: [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

This example imports a list of contacts in a .csv file named TerryAdams.csv to a mailbox for a user whose email address is terrya@contoso.edu.

Import-ContactList -CSV -CSVData ([System.IO.File]::ReadAllBytes("D:\Users\Administrator\Desktop\TerryAdams.csv")) -Identity terrya@contoso.edu

The Import-ContactList cmdlet submits a request to import a list of mail contacts that are contained in a .csv file to a cloud-based mailbox. Many MAPI and Web-based email clients allow users to export contacts to a Microsoft Office Outlook .csv format. Users can then provide that .csv file to you to import contacts to their cloud-based mailbox. During the import process, Microsoft Exchange matches the column names in the header row of the .csv file to the property names of an Exchange contact.

You need to be assigned permissions before you can run this cmdlet. Although all parameters for this cmdlet are listed in this topic, you may not have access to some parameters if they're not included in the permissions assigned to you. To see what permissions you need, see the "Recipient provisioning permissions" section in the Recipients Permissions topic.

 

Parameter Required Type Description

CSV

Required

System.Management.Automation.SwitchParameter

The CSV parameter simply specifies that the contacts will be imported from a .csv file.

CSVData

Required

System.Byte[]

The CSVData parameter specifies the .csv file you want to import. Use the following syntax for this parameter: ([System.IO.File]::ReadAllBytes("<file name and path>")). For example, ([System.IO.File]::ReadAllBytes("C:\My Documents\Contacts.csv")).

CSVStream

Required

System.IO.Stream

This parameter is reserved for internal Microsoft use.

Identity

Required

Microsoft.Exchange.Configuration.Tasks.MailboxIdParameter

The Identity parameter specifies the target mailbox to which the contacts are imported. You can use any value that uniquely identifies the mailbox.

For example:

  • Name

  • Display name

  • Alias

  • Distinguished name (DN)

  • Canonical DN

  • <domain name>\<account name>

  • Email address

  • GUID

  • LegacyExchangeDN

  • SamAccountName

  • User ID or user principal name (UPN)

Confirm

Optional

System.Management.Automation.SwitchParameter

The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on if the cmdlet requires confirmation before proceeding.

  • Destructive cmdlets (for example, Remove-* cmdlets) have a built-in pause that forces you to acknowledge the command before proceeding. For these cmdlets, you can skip the confirmation prompt by using this exact syntax: -Confirm:$false.

  • Most other cmdlets (for example, New-* and Set-* cmdlets) don't have a built-in pause. For these cmdlets, specifying the Confirm switch without a value introduces a pause that forces you acknowledge the command before proceeding.

WhatIf

Optional

System.Management.Automation.SwitchParameter

The WhatIf switch simulates the actions of the command. You can use this switch to view the changes that would occur without actually applying those changes. You don't need to specify a value with this switch.

To see the input types that this cmdlet accepts, see Cmdlet Input and Output Types. If the Input Type field for a cmdlet is blank, the cmdlet doesn’t accept input data.

To see the return types, which are also known as output types, that this cmdlet accepts, see Cmdlet Input and Output Types. If the Output Type field is blank, the cmdlet doesn’t return data.

 
Show: