When building a Query-based Distribution Group in Exchange 2003/2007, the GUI does not allow you to filter out disabled users or hidden users.
This has greatly limited the effectiveness of such groups for my work, until now!
Using ADSIEDIT.MSC you can modify the LDAP filter easily to resolve this issue.
- start ADSIEDIT.MSC
- under the Domain branch, find the group your created through the Active Directory Users and Computers (ADUC)
- double-click on the group
- find the msExchDynamicDLFilter attribute and edit it
- just in the last ‘)’ add the following: (!userAccountControl:1.2.840.1135184.108.40.2063:=2)(!msExchHideFromAddressLists=TRUE)
- go back to ADUC and find your group, and run the preview and make sure it works