I have a function which does adsi updates called set-adsiobj
The main code is here:
try {
$adobj = [ADSI]"LDAP://$ObjectDN"
$adobj.PutEx($PutexAction, $Attribute, @($Value))
$adobj.setinfo()
return $true
}
catch {
$global:SetAdsiError = $_
return $false
}
If I call a function like this with valid params: $result = get-adsiobj …
… the value of $result is weird
i.e. if the setinfo succeeds, $result is a two element array with the second element = $true
if the setinfo fails, $result is a three element array with the third element = $false
Any idea of whats happening or how I can get this to return simply true or false?
btw - the other elements in the array are $null. Its like the putex or setinfo are returning null values?