You want to create a query-based distribution list.
Creating a mail-enabled query-based distribution list requires the Exchange organization be in Exchange Native Mode. See MS KB 829577.
Open the ADUC snap-in.
This needs to be run on a workstation or server that has the Exchange Management Tools loaded (see Recipe 17.6).
If you need to change domains, right-click on Active Directory Users and Computers in the left pane, select Connect to Domain, enter the domain name, and click OK.
In the left pane, browse to the parent container of the new object, right-click on it and select New → Query-based Distribution Group.
Enter the group name and mail alias and click Next.
Select the search base, enter the specifics of the filter, and then click Next.
The filter should be a standard LDAP filter—e.g.,
Verify the summary and click Finish.
First, you need to create an LDIF file called add_qbdl.ldf with the following contents:
<QB DL Name>,
<ParentDN>changetype: add cn:
<QB DL Name>displayName:
<QB DL Name>objectClass: msExchDynamicDistributionList mailNickname:
<legacy Exchange DN>msExchDynamicDLFilter:
<BaseDN>reportToOriginator: TRUE systemFlags: 1610612736
with the name of the address list,
nickname> with ...