Dynamic DL based on NON Filterable properties

Hi Readers,

Sharing a unique information about Dynamic Distribution Lists, From powershell you can create these but only for Filterable properties.


If you have to create the Dynamic DL based on NON Filterable custom properties than follow below steps:

From Exchange Console Click New Dynamic Distribution Group


Select the recipient types that you want to include in the filter & Change the recipient container where you want to apply filtering.


follow the wizard, don’t select anything & finish it.



Now open this DDL in ADSI ( RUN –> ADSIedit.msc)

First Clear the Attribute –> msExchQueryFilter



Now edit the filter –>msExchDynamicDLFilter


Example is below:


LDAP Filter Operators:

Operator Meaning
& AND, all conditions must be met
| OR, any of the conditions must be met
! NOT, the clause must evaluate to False
= Equality
>= Greater than or equal to (lexicographical)
<= Less than or equal to (lexicographical)

Now you have created the Dynamic DL based on Non Filterable attribute but how will you get the members as Powershell will throw error , you can’t extract members via below Shell command:

$a = Get-DynamicDistributionGroup “DDL”

Get-Recipient –RecipientPreviewFilter $a.RecipientFilter

Here is another TIP 🙂 , using dsquery you can extract the members of this DDL.

Use limit parameter for the number of members it should extract, if you think your condition may have 1000 members than set the limit above that.

dsquery * -filter “(&(!cn=SystemMailbox{*})(&(objectClass=user)(objectCategory=person)(msExchHomeServerName=*)(!(userAccountControl:1.2.840.113556.1.4.803:=2))(!(msExchHideFromAddressLists=TRUE))(c=US)(!(name=CAS_{*)(|(l=Marlborough)(l=Marlboro))(|(Nonfilterableattb=X)(Nonfilterableattb=Y)(Nonfilterableattb=Z)(Nonfilterableattb=A)(Nonfilterableattb=B)(Nonfilterableattb=C)(Nonfilterableattb=D)))))” -attr displayname -limit 100 >c:\membersqbdl.txt

If you encounter this situation, hope this article will assist you dealing with it.


Tech Wizard





One thought on “Dynamic DL based on NON Filterable properties

  1. Pingback: Mystery of Dynamic Distribution Lists Exchange Hybrid | Microsoft Technologies Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s