• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 400
  • Last Modified:

Query AD 2003 data into a file

Anyone have a script to query data from AD 2003 into a CSV/XLS/TXT ?

I only need data from these fields:
1. logon id
2. display name
3. dept
4. telephone no
5. pager
6. mobile
0
Panda 5888
Asked:
Panda 5888
1 Solution
 
Mike KlineCommented:
Give adfind a try

http://www.joeware.net/freetools/tools/adfind/index.htm

adfind -default -f "&(objectcategory=person)(objectclass=user)" samaccountname displayname department telephonenumber pager mobile  -csv > c:\users.csv

So there I only outputted a few attributes,  you can output any attributes you want.  Good list of the actual attribute names here

http://www.selfadsi.org/user-attributes-w2k3.htm

Thanks

Mike
0
 
Joseph DalyCommented:
Id go with dsquery/dsget for this.


Dsquery user -samid * -limit 0 | dsget user -samid -display -dept -tel -pager -fax > C:\outfile.txt

This will dump all the users in your domain to a text file with the info you requested.

http://ss64.com/nt/dsquery.html
http://ss64.com/nt/dsget.html
0
 
Panda 5888EngineerAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now