locked
Removing Attribute title RRS feed

  • Question

  • I have a script where i am setting a variable equal to the queary get-adorganizationalunit -identity 'GUID' | select distinguishedname. The script works fine and I get my DN out but the outut has the title before the distinguished name. I would like to just have the Dn not the attribute title. What am I missing here? Thanks.
    Tuesday, March 11, 2014 1:44 AM

Answers

  • Use the -ExpandProperty parameter of Select-Object, such as ...| Select-Object -ExpandProperty DistinguishedName
    • Marked as answer by rooster147 Tuesday, March 11, 2014 2:15 AM
    Tuesday, March 11, 2014 1:55 AM

All replies

  • Use the -ExpandProperty parameter of Select-Object, such as ...| Select-Object -ExpandProperty DistinguishedName
    • Marked as answer by rooster147 Tuesday, March 11, 2014 2:15 AM
    Tuesday, March 11, 2014 1:55 AM
  • Wow that was easy I never would of thought of that. Thanks for the tip that will come in handy!
    Tuesday, March 11, 2014 2:15 AM
  • RTM - that is what it is for.

    This also does it.

    $myvar=(get-adorganizationalunit identity 'GUID').DistinguishedName


    ¯\_(ツ)_/¯

    Tuesday, March 11, 2014 3:49 AM