• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 398
  • 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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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