Solved

Bulk error -creating external contacts in Exchange O365

Posted on 2014-02-11
2
869 Views
Last Modified: 2014-02-26
Hi,

I am trying to import 600 contact to the cloud using this command below :

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

The CSV only contain these entries:
Name      FirstName  LastName      ExternalEmailAddress

I checked all the entries and there is not empty entries but when I run the command it saw this error at the end. Any idea will be appreciated!

Invoke-Command : Cannot bind parameter 'Name' to the target. Exception setting
"Name": "The property value is invalid. The value can't contain leading or trailing whitespace."
At C:\Users\Lilxx\AppData\Local\Temp\tmp_0b1a7f54-5061-47c5-84f9-0fada19f412f
_gdlhupqx.ux3\tmp_0b1a7f54-5061-47c5-84f9-0fada19f412f_gdlhupqx.ux3.psm1:23617
char:29
+             $scriptCmd = { & <<<<  $script:InvokeCommand `
    + CategoryInfo          : WriteError: (:) [New-MailContact], ParameterBind
   ingException
    + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.Exchange.Manage
   ment.RecipientTasks.NewMailContact

Thanks
Libet
0
Comment
Question by:CGNET-TE
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 53

Accepted Solution

by:
Will Szymkowski earned 500 total points
ID: 39850858
This command is failing due to the "whitespace" that is assocaited in one or many cells in the CSV file. It is difficult to determine whitespace just by looking at it (especially trailing whitespace). You can refer to the link below which will help remove the leading or trailing whitespace in your CSV file.

Remove Leading or Trailing Whitespace from Excel

Will.
0
 

Author Closing Comment

by:CGNET-TE
ID: 39890349
thanks .
0

Featured Post

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
This video discusses moving either the default database or any database to a new volume.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question