Extract Users From One Particular OU

D

Diane Walker

We are running Windows 2003 Standard Edition server. We would like to
retrieve all the users in one particular OU in Active Directory. Is there a
utility that we can use?

Thank you.

Diane
 
H

Herb Martin

Diane Walker said:
We are running Windows 2003 Standard Edition server. We would like to
retrieve all the users in one particular OU in Active Directory. Is there
a utility that we can use?

DSQuery (command line)

AD Users and Computers: Saved Queries

What specifically do you mean by "Extract"? These tools will get you
the users (etc) listed.

You might also consider LDAPDE.exe or CSVDE.exe for bulk
export/import.

Custom scripts work too of course.
 
P

Paul Bergson [MVP-DS]

You could use adfind from www.joeware.net. It is a great free tool. The
command below will output the users to the file employees.csv with the
samaccountname, e-mail address and Display name. Fields output are defined
by the script writer.

adfind -f "(&(objectclass=user)(objectcategory=person))" -b
"ou=employees,ou=users,dc=mydomain,dc=com" -csv -nodn samaccountname mail
displayName > c:\employees.csv


--
Paul Bergson
MVP - Directory Services
MCT, MCSE, MCSA, Security+, BS CSci
2003, 2000 (Early Achiever), NT

http://www.pbbergs.com

Please no e-mails, any questions should be posted in the NewsGroup
This posting is provided "AS IS" with no warranties, and confers no rights.
 
R

Richard Mueller [MVP]

Herb Martin said:
DSQuery (command line)

AD Users and Computers: Saved Queries

What specifically do you mean by "Extract"? These tools will get you
the users (etc) listed.

You might also consider LDAPDE.exe or CSVDE.exe for bulk
export/import.

Custom scripts work too of course.

Another command line utility that can output information on users is Joe
Richards' free adfind:

http://www.joeware.net/win/free/tools/adfind.htm

With all of these you can specify the OU as the base of the search. You
select which attribute values to retrieve.
 
D

Diane Walker

Thanks for your response. Sorry for not making my question clear. What I
mean by "extract" is to get a list.

Thanks.

Diane
 
D

Diane Walker

Paul,

Thank you very much for the information and the example. Your example
works. You have made it easy for me. Is there a way to find all the names
of the attributes such as Office, Department, Company, Telephone Number,
Account Expires, etc.? These fields are in Active Directory for Users and
Computers.

Thanks.

Diane
 
H

Herb Martin

Diane Walker said:
Thanks for your response. Sorry for not making my question clear. What I
mean by "extract" is to get a list.

Then tools like DSQuery can be all you need.

The bulk export/import tools are more for getting all the properties etc.

Joe's ADFind (mentioned by others) is useful to know in any case.
 
P

Paul Bergson [MVP-DS]

I am writing an update to one of my scripts and usually I run into the
Schema snapin to look up new attributes. Your spreadsheet is very nice!
This is a nice posting of information.

--
Paul Bergson
MVP - Directory Services
MCT, MCSE, MCSA, Security+, BS CSci
2003, 2000 (Early Achiever), NT

http://www.pbbergs.com

Please no e-mails, any questions should be posted in the NewsGroup
This posting is provided "AS IS" with no warranties, and confers no rights.
 
D

Diane Walker

Thank you very much all of you for the valuable information. Your
assistance is greatly appreciated. Richard, your documentation for AD
attributes is GREAT!!!

Thanks again all for everything.

Diane
 

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

Similar Threads

OU Structure 6
AD for Multi tenancy 0
Adding users to sub OU using Script 2
ADUC without adminpak installation 4
OU vs Domain 5
Rename "Users" OU 14
OU Exceptions. 4
Listing all the users in a group 4

Top