code examples How To Tips & Tricks

Exporting a list of all computers from Active Directory

Last week I covered how you can use the DSQuery command to export members of a given AD Group. This week, on a related note, I will cover how to use the same basic command to export all computer accounts in Active Directoy.

  1. Log on to your Domain Controller
  2. Open a command prompt
  3. Enter the command dsquery computer -limit %####% > filename.txt, substituting %####% for the maximum number of hits you want (if you leave this out, the default is 100), and replacing filename with something logical if you so desire

3 replies on “Exporting a list of all computers from Active Directory”

Exporting a list of a given users group memberships from Active Directory | STFU && RTFMsays:

[…] while back, I showed you how to export a list of all members of a group, as well as all computers, from Active Directory. On a related note, here’s how to export all group memberships held by […]

There is another fast and easy method how to export AD data to csv, xlsx and html files. No scripting required.
Active Directory reporting tool – AD FastReporter Free(
No configuration needed, it will use your current security context(your current user) to get all data from AD.
Just select Computers -> All Computers and choose fields you want to see(like Name, Group membership, Last logon, etc.), press Generate and you will see results in couple seconds.

Leave a Reply to Klavs Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.