Omit disabled accounts from a Query Based Distribution List

Posted on 2007-08-10
Last Modified: 2011-10-03
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.
Question by:acpress
    LVL 35

    Accepted Solution

    LVL 30

    Assisted Solution

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Want to promote your upcoming event?

    Are you going to an event? Are you going to be exhibiting at a tradeshow? Talking at a conference? Using a promotional banner in your email signature ensures that your organization’s most important contacts stay in the know and can potentially spread the word about the event.

    Create high volume marketing opportunities using email signatures with these top 10 DOs and DON'Ts of email signature marketing.
    "Migrate" an SMTP relay receive connector to a new server using info from an old server.
    In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
    This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now