Cannot bind parameter ‘RecipientFilter’ to the target. Exception setting “RecipientFilter”

Printer-friendly versionPDF version
Exchange 2010 Hosting

Full error:

Invoke-Command : Cannot bind parameter ‘RecipientFilter’ to the target. Exception setting “RecipientFilter”: “Invalid filter syntax. For a description of the filter parameter syntax see the command help.

“((UserPrincipalName -like ‘*@domain2.com’) -and (Alias -ne ))” at position 67.”

At *:39341 char:29

+ $scriptCmd = { & <<<< $script:InvokeCommand `

+ CategoryInfo : WriteError: (:) [Set-EmailAddressPolicy], ParameterBindingException

+ FullyQualifiedErrorId : ParameterBindingFailed, Microsoft.Exchange.Management.SystemConfigurationTasks.SetEmailAddressPolicy

 

This error is caused by an invalid syntax when setting the RecipientFilter. Normally when using powershell commands you will enclose everything in quotes. This is not the case with the RecipientFilter. You must put the value in-between curly braces { }.

Wrong:

  • -RecipientFilter "((UserPrincipalName -like '*@domain2.com') -and (Alias -ne $null))"

CORRECT:

  • -RecipientFilter {((UserPrincipalName -like '*@domain2.com') -and (Alias -ne $null))}

nice article.....

Post new comment