Exchange Server 2013 - Unable to use "PrimarySmtpAddress" as a filterable property in a Dynamic Distribution List

Unable to use PrimarySmtpAddress as a filterable property in a Dynamic Distribution List in Exchange 2013 server.

 

Question:

I want to create a Dynamic Distribution List based on “PrimarySmtpAddress”. Though this MS Technet article https://docs.microsoft.com/en-us/powershell/exchange/exchange-server/recipient-filters/recipientfilter-properties?view=exchange-ps does says PrimarySmtpAddress is a filterable property, but in reality the option is not working. The “PrimarySmtpAddress” property not working for both create and modify the Dynamic DL.

Example:

New-DynamicDistributionGroup "TestDynamicDL" -OrganizationalUnit "abc.com" -RecipientContainer "abc.com/users" -RecipientFilter {(RecipientType -eq 'UserMailbox') -and (PrimarySmtpAddress-like "*abc.com")}

Set-DynamicDistributionGroup "TestDynamicDL" -RecipientContainer "abc.com/users" -RecipientFilter {(RecipientType -eq 'UserMailbox') -and (PrimarySmtpAddress-like "*domain.com")}

Error:

While running the above commands it shows the below error: Property PrimarySmtpAddress does not support Microsoft.Exchange.Data.TextFilter”

 

[PS] C:\Windows\system32>New-DynamicDistributionGroup "TestDynamicDL" -OrganizationalUnit "abc.com" –RecipientContainer "abc.com/users" -RecipientFilter {(RecipientType -eq 'UserMailbox') -and (PrimarySmtpAddress-like "*abc.com")}

Creating a new session for implicit remoting of "New-DynamicDistributionGroup" command...

Property PrimarySmtpAddress does not support Microsoft.Exchange.Data.TextFilter. Only

Microsoft.Exchange.Data.ComparisonFilter is supported.

    + CategoryInfo          : NotSpecified: (:) [], ADFilterException

    + FullyQualifiedErrorId : [Server=abcdmbx01,RequestId=8431d2b9-69cd-4596-a9a6-bb8a508fee2a,TimeStamp=12.01.201

   9 17:53:54] [FailureCategory=Cmdlet-ADFilterException] 8858BF05

    + PSComputerName        : abcdmbx01.abc.com

I need to filter the users based on only Primary Email Address. Since "EmailAddresses" property does not serve my requirement, i am looking for help/suggestion to achieve my goal.

Any help would be highly appreciated. 

___________________________________________________

Bill Smithers - Microsoft MVP July 2013 - Dec 2020

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Hi,

My name is Angel. I am an Independent Advisor. Thank you for posting in Microsoft Community.

Try with this:

$smtpFilter = [scriptblock]::create(" primarysmtpaddress -eq `"*abc.com`" " )
New-DynamicDistributionGroup "TestDynamicDL" -OrganizationalUnit "abc.com" –RecipientContainer "abc.com/users"
-RecipientFilter {(RecipientType -eq 'UserMailbox') -and ($smtpFilter)}

Hope the information provided is useful. If the issue persists, reply here and we will be glad to help you.

Angel.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Hi Angel,

I run the command and got the below error.

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.

"(RecipientType -eq 'UserMailbox') -and ($smtpFilter)" at position 41."

    + CategoryInfo          : WriteError: (:) [New-DynamicDistributionGroup], ParameterBindingException

    + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.Exchange.Management.RecipientTasks.NewDynamicDistributi

   onGroup

    + PSComputerName        : abcdmbx01.abc.com

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

As I advised you, you ask in the TechNet forums.
___________________________________________________

Bill Smithers - Microsoft MVP July 2013 - Dec 2020

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated June 28, 2020 Views 224 Applies to: