All Groups address list and Query-Based Distribution Groups

by Bharat Suneja

You create new Query-Based Distribution Groups but they don’t show up in the All Groups address list in Outlook clients – cached mode or not.

QBDGs are not really groups, as far as Active Directory goes. They’re instantiated from a new class – msExchDynamicDistributionList.

The default ldap filter for All Groups address list, stored in the address list’s purportedSearch attribute – is:

(& (mailnickname=*) (| (objectCategory=group) ))

No wonder it doesn’t pick up the QBDGs.

To make QBDGs show up in the All Groups address list, you will need to edit the purportedSearch attribute of All Groups.

– Fire up ADSIEdit and expand Configuration | Services | Microsoft Exchange | YourExchangeOrgName | Address Lists Container | All Address Lists.
– Right-click All Groups container | properties
– Scroll down and locate the purportedSearch attribute | click Edit
– after (objectCategory=Group), insert: (objectClass=msExchDynamicDistributionList)

so it looks like:

(& (mailnickname=*) (| (objectCategory=group) (objectClass=msExchDynamicDistributionList) ))

Now go ahead and check the All Groups address list in Outlook. If you’re in Outlook 2003 Cached Mode you may need to download entire Address Book (uncheck “Download Changes since last update… “).

{ 14 comments… read them below or add one }

Admin February 10, 2006 at 9:48 am

Hi,
It’s great to came across your post about how to change this.
I made the change and everything works great except the icon of the group changed as well. Do you know how to modify so that I can see the group icon in the GAL?
THanks.

Reply

Admin February 10, 2006 at 9:49 am

Hi,
It’s great to came across your post about how to change this.
I made the change and everything works great except the icon of the group changed as well. Do you know how to modify so that I can see the group icon in the GAL?
THanks.

Reply

Admin February 10, 2006 at 9:49 am

Hi,
It’s great to came across your post about how to change this.
I made the change and everything works great except the icon of the group changed as well. Do you know how to modify so that I can see the group icon in the GAL?
THanks.

Reply

Trenton Van Vickle - [email protected] March 27, 2007 at 7:31 pm

Hi there, I was looking at my purportedSearch attribute and well it’s blank. Any thoughts on where I should look now?
Thanks.

Reply

scrantic May 24, 2007 at 12:54 am

I mad an extra address list called distribution groups and set a custom atrrib for 1 called Dynamic Distribution and the address list contains them.

Reply

nikolay September 28, 2007 at 4:34 am

Hi,
How can i hide a disable users in groups. In global address book i can see a disable users – it’s not right!
Thx!

Nikolay Kutsenko

Reply

Bharat Suneja September 28, 2007 at 8:40 am

Nikolay,

Take a look at Query-based Distribution Groups and Disabled Users

You can similarly modify the ldap filters for any Address List or Global Address List.

Reply

- Matt December 7, 2007 at 10:05 am

I can see how to exclude the disabled users in QBDG’s. But like Nikolay mention, how can this be applied to exclude the disabled users when your viewing the GAL? Anyone done it??

Thanks.

– Matt

Reply

- Matt December 7, 2007 at 1:49 pm

I did figure it out! I seen this article from MS: http://technet.microsoft.com/en-us/library/aa996205.aspx

I then used (!msExchUserAccountControl=2) in purportedSearch attribute to exclude the disabled users.

Here is what I used to exclude disabled users in the GAL:
(&(mailnickname=*)(|(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(!msExchUserAccountControl=2)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList) ))

Here is what I used to exclude disabled users in the All Users List:
(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(!msExchUserAccountControl=2)(|(homeMDB=*)(msExchHomeServerName=*))) ))

Hope it helps..

– Matt

Reply

addicha April 6, 2008 at 11:20 pm

BTW, You should know that doing this will cause a failure while adding a new Exchange 2007 to the environment.

See MS article: 936907

Addiel C.

Reply

Anonymous August 20, 2010 at 4:58 am

how to exclude few colleagues from a query based DL

Reply

Bharat Suneja August 23, 2010 at 12:44 pm

– If all colleagues have a common Active Directory attribute, you could use a NOT clause in the LDAP query to exclude them based on that attribute.
– If not, you can populate one of the extension attributes for all of them, and then modify filter to exclude those users based on the extension attribute value. For example: (!extensionAttribute12=foo)
– Alternatively, you can add them to a distribution group and exclude the distribution group members using memberOf attribute in the filter. For example: (!memberOf=CN=MyGroup,OU=MyOU,DC=MyDomain,DC=com)

Reply

Rudra Singh February 25, 2015 at 1:10 pm

I am looking for a script to print a list of members of distribution list from outlook 2010 with name and ddress to a a text file. i was able to write a script and see all in a immediate display window. but i need to put in a text file. Thanks in advance for any help. new to VBA
Rudra Singh

Reply

Bharat Suneja February 25, 2015 at 4:19 pm

Plenty of resources on the web that’ll show how to create or append to a text file. See Reading and Writing Text Files.

But it’s easier and faster if you use PowerShell.

Reply

Leave a Comment

Previous post:

Next post: