Solved

Bulk error -creating external contacts in Exchange O365

Posted on 2014-02-11
2
834 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
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

939 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now