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

Active Directory User dump

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??)

Thanks.
CSVDE -f onlyusers.csv -r objectCategory=person

Open in new window

0
susnewyork
Asked:
susnewyork
  • 2
1 Solution
 
Mike KlineCommented:
What I like for this is a tool called adfind by MVP Joe Richards
http://www.joeware.net/freetools/tools/adfind/index.htm
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.
Thanks
Mike
 
 
 
0
 
susnewyorkAuthor Commented:
Thank you, however I am looking for a complete dump of ALL users, but with a way to sort active and disabled.

0
 
Mike KlineCommented:
Ok,  the issue there is that if the user is enabled or disabled is part of useraccountcontrol
http://support.microsoft.com/kb/305144
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
Thanks
MIke
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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