Link to home
Start Free TrialLog in
Avatar of CGNET-TE
CGNET-TE

asked on

Bulk error -creating external contacts in Exchange O365

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
ASKER CERTIFIED SOLUTION
Avatar of Will Szymkowski
Will Szymkowski
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CGNET-TE
CGNET-TE

ASKER

thanks .