Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Directory Harvesting Tip

Status
Not open for further replies.

Cstorms

IS-IT--Management
Sep 29, 2006
556
US
For those of you who are looking to find a way to obtain particular user information for each user object I thought I would give some examples as I have been using them recently to verify fields.

using the dsquery to pipe info to the dsget

dsquery user -limit 1000 | dsget user -samid -email > c:\file.csv

above example will get the users (up to 1000 as default is 100) sam account and their email attribute. At the end I wanted to export this list to a csv file..


Link below to get other parameters that you can harvest.


Thought sharing the tip would maybe get the rest of you thinking if you are stumped on something like this. Have a good day!



Cory
 
same can be done with ldifde or csvde:

ldifde -d "DC=domain,DC=com" -r "(objectClass=user)" -l sAMAccountName,userPrincipalName,email,proxyAddresses -f c:\output.txt


csvde -d "DC=domain,DC=com" -r "(objectClass=user)" -l sAMAccountName,userPrincipalName,email,proxyAddresses -f c:\output.csv

-Brandon Wilson
MCSE00/03, MCSA:Messaging00, MCSA03, A+
Manager - Global AD Operations
ACS, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top