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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export users and computers to Excel

Status
Not open for further replies.

godzuki

Programmer
Apr 18, 2002
46
GB
Can anybody tell me if there is a way to export a list of user and computers in AD to excel..?

Thanks
 
There are a number of ways to export user lists to text files. To export users to CSV (and opened in excel) I would use CSVDE from the command line.

You can also use the DSTOOL with Windows 2003 to export to file.
 
excellent could you give me an example to output just users and computers, sorry if i'm being a bit thick..its a w2000 server by the way..oh and whilst you here, do you know how to export a list of user mailboxes also in exchange

thanks
 
Firstly, you will need to download the DStools from the microsoft website, they are in the Windows 2003 area I think. Also you will be required to copy CSVDE.exe to your machine. However, before running either CSVDE or DSTools I would use in a test environment until you are comfortable. If you use the wrong switches you could do some damage.


CSVDE
The link below gives a few examples of CSVDE, see example 1 on how to export a list of all users in AD. The further examples show how torefine your search to a specific OU or specific data



DSTOOLS
This is useful for pulling out very specific information from AD. The example below shows how to get the email address (-email switch) from the my_users ou in mydomain.mydomain.com.

This works by using DSQUERY to find the user then piping (|)this information into DSGET which then pulls back the email address (-email) and exporting to file ( >> UsersEmailAddresses.txt)

DSQUERY USER "ou=my_users,dc=mydomain,dc=mydomain,dc=com"|DSGET USER -email >> UsersEmailAddresses.txt


Hope this is of some use.......
 
godzuki,

Alternatively, you can right click on any OU in Active Directory and select export. You can save the file as a .txt or .csv.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top