All Groups address list and Query-Based Distribution Groups

by Bharat Suneja on December 27, 2005

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… “).

{ 12 comments… read them below or add one }

1 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

2 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

3 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

4 Trenton Van Vickle - tvanvick@americanchemistry.com 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

5 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

6 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

7 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

8 - 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

9 - 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

10 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

11 Anonymous August 20, 2010 at 4:58 am

how to exclude few colleagues from a query based DL

Reply

12 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

Leave a Comment

Previous post:

Next post: