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.

https://technet.microsoft.com/en-us/library/bb738157%28v=exchg.150%29.aspx

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

Capture

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

Capture1

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

Capture2

 

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

First Clear the Attribute --> msExchQueryFilter

Capture3

Capture4

Now edit the filter -->msExchDynamicDLFilter

Capture

Example is below:

(&(!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)))))

LDAP Filter Operators:































OperatorMeaning
&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.

Regards

Sukhija Vikas

http://msexchange.me

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. […]

    ReplyDelete