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.
LVL 2
acpressAsked:
Who is Participating?
 
rakeshmiglaniCommented:
0
 
LauraEHunterMVPCommented:
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:

(UserAccountControl:1.2.840.113556.1.4.803:=2)

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

(!UserAccountControl:1.2.840.113556.1.4.803:=2)

I wouldn't overuse this because it's an inefficient query between the NOT and the fact that userAccountControl isn't indexed.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.