Solved

Query users with CSVDE with an exclusion

Posted on 2006-07-06
6
2,017 Views
Last Modified: 2011-10-03
Hi,

I'm tryng to get a csv file that will contain all users with:

First Name+Last Name+Has a mailbox+Has a manager configured.
And I want to exclude all the diabled users from that query !

This is the way I can pull out all users that are not service accounts and also are not kind of wierd accounts like "test" users and so on.

I need the exact sysntax for CSVDE and also LDAP query in ADUC.

Thanx.
0
Comment
Question by:EERetUser
  • 3
  • 3
6 Comments
 
LVL 26

Expert Comment

by:Pber
ID: 17062123
I'm not sure on CSVDE as I don't use that, but the ADUC query would be:

(&(&(objectCategory=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)(homeMDB=*)(manager=*)))

0
 

Author Comment

by:EERetUser
ID: 17067283
Thanx,

This answers about the LDAP query but I need also to put it on a CSV with all coloumns.
So this list is filtered ok, but can't be shown.

So again, I need the CSVDE option so I can get the list.
0
 
LVL 26

Accepted Solution

by:
Pber earned 250 total points
ID: 17072326
Here's the csvde syntax:

csvde -p subtree -r "(&(objectCategory=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)(homeMDB=*)(manager=*))" -l "givenname, sn" -f c:\users.csv

This will output output all enabled users with mailboxes and have a manager assigned.  It will only return the dn, lastname and firstname.  If you want it to return all attributes remote the -l option:

csvde -p subtree -r "(&(objectCategory=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)(homeMDB=*)(manager=*))"  -f c:\users.csv

You can also just use the ""(&(objectCategory=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)(homeMDB=*)(manager=*))"  query in ADUC as a custom query and then just Export list.

Hope that helps
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 26

Expert Comment

by:Pber
ID: 17103387
Were you able to get this working?
0
 

Author Comment

by:EERetUser
ID: 17104015
I'm on a training, This is the first thing I'll do when I come back.

Thanx.
0
 

Author Comment

by:EERetUser
ID: 17166167
Thanx, this did the job.
0

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

Join & Write a Comment

Recently, I had the need to build a standalone system to run a point-of-sale system. I’m running this on a low-voltage Atom processor, so I wanted a light-weight operating system, but still needed Windows. I chose to use Microsoft Windows Server 200…
Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

760 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

25 Experts available now in Live!

Get 1:1 Help Now