Solved

Bulk error -creating external contacts in Exchange O365

Posted on 2014-02-11
2
826 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
Comment Utility
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
Comment Utility
thanks .
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
"Migrate" an SMTP relay receive connector to a new server using info from an old server.
To show how to create a transport rule 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 Mail Flow >> Rules tab.:  To cr…
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

771 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

10 Experts available now in Live!

Get 1:1 Help Now