Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Bulk error -creating external contacts in Exchange O365

Posted on 2014-02-11
2
Medium Priority
?
968 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 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

916 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