locked
Get multi-valued OU Description RRS feed

  • Question

  • I have to set several custom attributes for OUs and want to use the multi-valued Description attribute. I can set a multi-valued Description with this statement:

    $testOU | Set-ADOrganizationalUnit -replace @{description='Test2','Test1'}

    That works. But I've not been able to figure out how to return the values. Everything I've tried returns the 1st item in the multi-value list; it never returns an array.

    I would like to use ActiveDirectory module, not QAD.

    • Edited by JRV529088 Sunday, August 19, 2012 2:26 AM
    Saturday, August 18, 2012 8:21 PM

Answers

  • OK, finally found an approach that gets me an array (a collection, actually, but I'll take it):

    $ou = [adsi]"LDAP://OU=TestOU,DC=domain,DC=local"
    

    $ou.Description then gives us:

    Test1
    Test2

    Although I now have a solution, I would still be interested in knowing if there's a way to coax multi-values beyond the first one out of the OU Description property using Get-ADOrganizationalUnit or Get-ADObject, if someone has a moment to show me.

    • Marked as answer by JRV529088 Sunday, August 19, 2012 3:20 AM
    Sunday, August 19, 2012 3:20 AM