• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 553
  • Last Modified:

Omit disabled accounts from a Query Based Distribution List

I have previously created several managed Distribution Lists prior to moving over to native mode.  Now I would like replace the managed distribution lists with dynamic, Query Based Distribution Lists (QBDL).  
I have no problem creating various distribution lists, based on OU, Department and other criteria. However, I need help figuring out how to omit DISABLED ACCOUNTS (without moving them into other OU's) from the QBDL's
Our 2003 AD is operating in native mode.  Running Exchange Server 2003.
2 Solutions
Whether a user is enabled or disabled is controlled by the userAccountControl attribute, which is a bitwise attribute.  Aquery on disabled users would be an AND query against bit 2, like this:


To query for only enabled users, you'll need to put a NOT operator in front of it:


I wouldn't overuse this because it's an inefficient query between the NOT and the fact that userAccountControl isn't indexed.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now