How To Export A Computer List From Active Directory

Skip to content Menu

In this blog will see how to export a computers list from Active Directory by using Powershell script into various formats, including csv and Excel.

Open the Powershell ISE → Run the below script, adjust the path for the export:

Get-ADComputer -Filter * -Property * | Select-Object Name,OperatingSystem,OperatingSystemVersion,ipv4Address | Export-CSV ADcomputerslist.csv -NoTypeInformation -Encoding UTF8

Using dsquery

Go to a command prompt and type the command listed below:

dsquery computer > computers.txt

Press Enter. You will now have a computers.txt text file containing the computer accounts in your organization.

In order to export a list of computers in OUs and Sub OUs:

DSQUERY COMPUTER "OU=expert,DC=serc,DC=col" -name * -scope subtree -limit 0 > d:\ComputersinOU.TXT DSQUERY OU "OU=expert,DC=serc,DC=col" -name * -scope subtree -limit 0 > d:\OUexpert.TXT

DSQUERY COMPUTER – start querying AD for computer objects “OU=expert,DC=serc,DC=col” – start search in this OU -name * – get specified computer name, in case you are using * (asterisk) then it means, any name -scope subtree – search also in all subOUs, not only oin specified one -limit 0 – by default DSQUERY will return the firs 100 found objects, you can overwrite it using any other value or 0. 0 means return all of them > d:\ComputersinOU.TXT – this says, redirect all output to text file on D-Drive instead of displaying their names on a screen

Looking for Specific Information?

Search for:

Recent Posts

  • Exchange Hybrid Mailbox Migration: Step-by-Step Guide with Minimal Downtime
  • How to Fix AADSTS90023 Error in Microsoft Teams Guest Sign-In Issues on Mobile App
  • How to Delete Microsoft Teams Chat History – User & Admin Guide
  • Wordle and Quordle Explained: Hints, Tips, Where to Play & How to Master Today’s Puzzle
  • Microsoft Teams Channel Restore Search Issue Explained | Fix Missing Channel Messages After Restore

Our Most-Read Blog Posts

User Login History, Statistics and Activity Reports in the Office 365 How to Fix – Microsoft Outlook Error Code 0x8004011d Top 3 Exchange Mailbox (.edb) Recovery Tools iPhone and iPad Data Recovery Software Top 3 EDB to PST Converter Software Top 3 OST to PST Converter Software

Tag » Active Directory Export Computer List Operating System