Hi,
Can anyone tell me whats going wrong here? Im using this cmdlet to try and import some mail contacts in Exchange Powershell
But it errors every time on the 6th contact in!![Frown :( :(](/styles/default/xenforo/vbSmilies/Normal/frown.gif)
Any ideas?
Can anyone tell me whats going wrong here? Im using this cmdlet to try and import some mail contacts in Exchange Powershell
Import-CSV C:\ch.csv | ForEach-Object {New-MailContact -Name ($_."First Name"+" "+$_."Last Name") -DisplayName ($_."First Name"+" "+$_."Last Name") -FirstName $_."First Name" -LastName $_."Last Name" -OrganizationalUnit $_."Organizational Unit" -ExternalEmailAddress $_."EmailAddress" }
But it errors every time on the 6th contact in!
![Frown :( :(](/styles/default/xenforo/vbSmilies/Normal/frown.gif)
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 USER FOLDER PATH
1.contoso.com.psm1:27888 char:29
+ $scriptCmd = { & <<<< $script:InvokeCommand `
+ CategoryInfo : WriteError: ( : ) [New-MailContact], ParameterBindingException
+ FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.Exchange.Management.RecipientTasks.NewMailContact
Any ideas?
Last edited: