Wednesday, May 6, 2015

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:

&AND, all conditions must be met
|OR, any of the conditions must be met
!NOT, the clause must evaluate to False
>=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.


Sukhija Vikas

1 comment:

  1. […] Creation of Dynamic Distribution Lists on Exchange online is not always an option if your Dynamic Lists are based on Non Filterable Attributes. […]