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


  1. Pingback: Exporting a list of a given users group memberships from Active Directory | STFU && RTFM
  2. 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(https://albusbit.com/ADFastReporter.php).
    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.

By posting a comment, you consent to our collecting the information you enter. See privacy policy for more information.

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