Powershell Script and virtual attributes

Hello all,

In a PowerShell Script, I use "$NewStreet = $DirObj.Get("street")" and it work fine.

But if i use the same commande with a Virtual Attributes it's doesn't work:

$Location = $DirObj.Get("CompanieLocation") 

How can I use Virtual Attributes in PowerShell Script?

Thanks ;)

Gégé

Parents
  • $DirObj only contains a limited set of properties and I can't recall how you add more.

    Here's a couple of other ways though:

    # Both require Quest cmdlets be installed on your scripting host


    $Location = get-qaduser -proxy -identity $myuser -includedproperties CompanieLocation | select -expandproperty CompanieLocation

    $Location

    OR

    $MyObj = [ADSI]"EDMS://$UserDistinguishedName"

    $MyObj.refreshcache(@("CompanieLocation"))

    $MyObj.CompanieLocation

    $MyObj.close()

Reply
  • $DirObj only contains a limited set of properties and I can't recall how you add more.

    Here's a couple of other ways though:

    # Both require Quest cmdlets be installed on your scripting host


    $Location = get-qaduser -proxy -identity $myuser -includedproperties CompanieLocation | select -expandproperty CompanieLocation

    $Location

    OR

    $MyObj = [ADSI]"EDMS://$UserDistinguishedName"

    $MyObj.refreshcache(@("CompanieLocation"))

    $MyObj.CompanieLocation

    $MyObj.close()

Children