How do I get a list of all Users using CSVDE

G

Guest

Hi
I am actually running this on a Windows 2003 server. I would like to get the result of something like the following in CSV format

dsquery user domainroot -limit 0 | dsget user -samid -display -tel -disable

But, can not get the CSVDE to produce the same data set or all employees. We have multiple domains and OUs in the AD. How could I replicate the command above using CSVDE for all employees

Thank
 
E

Eric Fleischman [MSFT]

Hi Jon,

I'm unfortunately not familiar with dsquery, but here's some syntax to get
you rolling with csvde:
csvde -r "(&(objectcategory=person)(objectclass=user))"

You can then use a flag such as -d to base the search against a given domain
or container or what have you.

If that doesn't do what you need just holler. Let me know what you're
looking for and I can give you more targeted syntax for your scenario!

~Eric
 
G

Guest

----- Eric Fleischman [MSFT] wrote: -----

Hi Jon,

I'm unfortunately not familiar with dsquery, but here's some syntax to get
you rolling with csvde:
csvde -r "(&(objectcategory=person)(objectclass=user))"

You can then use a flag such as -d to base the search against a given domain
or container or what have you.

Thanks for the reply...

I ended up using something like:

csvde -m -f UserList.csv -t 3268 -r "(&(objectClass=user)(objectCategory=person)(instanceType=0))" -p Subtree

I think the -t 3268 helped add a lot more objects. instanceType=0 helped me eliminate all items like ContactList users that were added by exchange... It seems to work now, but I am concerned, since I really tried to reverse engineer the data and am not sure whether something may happen in the future to affect my logic.

What do you think?
 
E

Eric Fleischman [MSFT]

3268 will hit the GC so that lets you do forest-wide searches rather than
just domain naming context searches (not taking in to account some nc's that
could be reached via referrals...)

If it gives you what you need, it's great! That's what is most important. :)

~Eric
 
G

Guest

What do you think about the filter
(instanceType=0

I got to that by browsing the data that was returned and discovering all the actual users appeared to have that value. I did this to make things like Personal Address book entries fall off... I could not find anything that listed various valid values for instanceType and what they indicated
 
E

Eric Fleischman [MSFT]

I can't answer that without looking at your data set.
If your goal is to just get security principals, you could also add a term
like: "(samaccountname=*)"

~Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top