Solved

Need to tweak CSVDE AD extract

Posted on 2012-04-06
3
806 Views
Last Modified: 2012-06-21
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!
0
Comment
Question by:OGSan
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
Anuroopsundd earned 500 total points
ID: 37818201
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
0
 
LVL 17

Expert Comment

by:Anuroopsundd
ID: 37818206
http://www.tek-tips.com/faqs.cfm?fid=5667  have more information about the values that can be used...
0
 
LVL 1

Author Comment

by:OGSan
ID: 37818216
Holy crap!  That was outstanding!  Thanks for that link, too, Anuroopsundd.
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

[b]Ok so now I will show you how to add a user name to the description at login. [/b] First connect to your DC (Domain Controller / Active Directory Server) SET PERMISSIONS FOR SCRIPT TO UPDATE COMPUTER DESCRIPTION TO USERNAME 1. Open Active …
Introduction You may have a need to setup a group of users to allow local administrative access on workstations.  In a domain environment this can easily be achieved with Restricted Groups and Group Policies. This article will demonstrate how to…
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…
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 …

758 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

14 Experts available now in Live!

Get 1:1 Help Now