Find all Disabled users in the Ads who do not have a Mailbox

Posted on 2007-10-01
Last Modified: 2010-04-16

I want a script to Find all Disabled users in the Ads who do not have a Mailbox.

Is there a way to find this.

Question by:bsharath
    LVL 26

    Accepted Solution

    Try this:

    Click Start -> Run -> Cmd.exe

    DSQuery * -Filter "(&(sAMAccountType=805306368)(UserAccountControl:1.2.840.113556.1.4.803:=2)(!homeMDB=*))" -Attr samAccountName

    OR (To search within a specific OU)

    DSQuery * "OU=ACCOUNTS,DC=TRAINING,DC=COM" -Filter "(&(sAMAccountType=805306368)(UserAccountControl:1.2.840.113556.1.4.803:=2)(!homeMDB=*))" -Attr samAccountName

    LVL 5

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
    Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
    The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    759 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

    7 Experts available now in Live!

    Get 1:1 Help Now