Active Directory User dump

Posted on 2009-04-21
Last Modified: 2012-08-13
Hi, I am using the following script to dump Server2003 AD to csv file.

CSVDE -f onlyusers.csv -r objectCategory=person

The script works fine but I want to tell if the user is disabled or not. Either the script does not pull this filed, OR I am not recognizing the column title for disabled account.

Can someone please tell me how to include this field in the dump, OR identify the field for me.

I am looking for a dump showing me all basic user information which is found on the AD GUI. (Is there a better script out there??)

CSVDE -f onlyusers.csv -r objectCategory=person

Open in new window

Question by:susnewyork
    LVL 57

    Expert Comment

    by:Mike Kline
    What I like for this is a tool called adfind by MVP Joe Richards
    For a dump of all enabled users use
    adfind -default -binenc -bit -f  "&(objectcategory=person)(objectclass=user)(!useraccountcontrol:AND:=2)" samaccountname givenname sn -csv > c:\enabledusers.csv
    What I did there was dump only samaccountname first and last name
    You can choose any fields you want.
    Hope that helps.
    LVL 1

    Author Comment

    Thank you, however I am looking for a complete dump of ALL users, but with a way to sort active and disabled.

    LVL 57

    Accepted Solution

    Ok,  the issue there is that if the user is enabled or disabled is part of useraccountcontrol
    So for instance a normal/disabled user has a value of 514 (512 for normal user + 2 for disabled)
    People may not understand sorting by that field.
    You could also take another export of disabled users (remove the ! from the previous query

    Featured Post

    Don't lose your head updating email signatures!

    Do your end users still have the wrong email signature? Do email signature updates bore you or fill you with a sense of dread? You can make this a whole lot easier on yourself by trusting an Exclaimer email signature management solution. Over 50 million users should you!

    Join & Write a Comment

    Some time ago I faced the need to use a uniform folder structure that spanned across numerous sites of an enterprise to be used as a common repository for the Software packages of the Configuration Manager 2007 infrastructure. Because the procedu…
    Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
    In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
    This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

    734 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

    22 Experts available now in Live!

    Get 1:1 Help Now