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:
Go to a command prompt and type the command listed below:
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: