Export Active Directory attributes to Excel based on OU

As Technet Gallery is retiring so moving the code to Git Hub. (click below github download link for this script)


Hi All,

This script is part two of Export active directory script


This works same as above except it will extract the data from particular OU.

No need of formating or  importing CSV to excel file as this will do all the work for you.

Note:- I have commented sizelimit 0 so as to see the output of first 1000 users, you can remove it so that all users can be exported.

Also, I have used extnsionattribute1 to extract some custom values, you can change that accordingly.

more info on http://techwizard.cloud

running from c:\scripts

Define OU :- $OU = ‘OU=Users,DC=Lab,DC=labtest,DC=com’ #define OU

Pls rate the contribution if it worked for you.

download Quest Management Shell (its a free shell) –> http://www.quest.com/powershell/activeroles-server.aspx

Thanks for reading …

Tech Wizard



PowerShell Cheat Book

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s