Need to tweak CSVDE AD extract

OGSan
OGSan used Ask the Experts™
on
Hi, Experts -
I need to tweak the following CSVDE utility code so that it only pulls the OU=Service Accounts...OR...if it can ignore OU=Disabled Accounts that would be just as good if not better.

I don't know what the syntax is though and nothing I try seems to work for me.

Here is the existing/working code that is pulling ALL accounts - I need to change this to pull only the Service Accounts, or to ignore the Disabled Accounts:
csvde.exe -f ADHT_Export.csv -b LDAP_query DDDD XXXXXX -s ad.company.com -v -r 
"(&(objectClass=user)(sn=*))" -l objectClass,sn,givenName,displayName,description,employeeID,sAMAccountName,mail

Open in new window

Many thanks for your help!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
CSVDE -f "c:\test.csv" -r "(&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2))"  -l objectClass,sn,givenName,displayName,description,employeeID,sAMAccountName,mail
http://www.tek-tips.com/faqs.cfm?fid=5667  have more information about the values that can be used...

Author

Commented:
Holy crap!  That was outstanding!  Thanks for that link, too, Anuroopsundd.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial