How can I get the "description" attribute of an OU in ActiveDirectory?
Solution 1:
Get-ADOrganizationalUnit -SearchBase $filterbase -filter * -Properties Description| export-csv $outcsv
Should be what you're looking for. In almost all cases, if you want additional properties returned, then -Properties
followed by a comma separated list of the additional properties is what you're looking for.
If you only want the three attributes that you mention in your question, then do something like:
Get-ADOrganizationalUnit -filter * -Properties Description | select-object name,distinguishedname,description | export-csv $outcsv