Export Computer Accounts From AD To CSV With PowerShell


Sometimes you need to have a list of all computer accounts in your or your customers Active Directory. And there is no good way to export that data from the GUI. To make this easy I have created a PowerShell script that exports all the computer accounts from an OU of your choice or from the whole domain. Read more after the break.

The script

This is a simple and straight forward PowerShell script. It’s using the account you are logged on with to perform the actions, and it will save the CSV-file in the same directory as the script.

You find instructions on what to edit in the ZIP-fil along with the script. The only thing you need to do is changing the search base string to fit your OU structure.

Download the script with this link: