Getting msExchRecipientDisplayType values via $dirObj, returns a System.__ComObject reference, not the integer.

I am writing a powershell policy script to detect remote mailbox types (EXO), ARS is not connected to Azure.
$DirObj.GetInfoEx(@("msExchRemoteRecipientType","msExchRecipientTypeDetails","mail"),0)
$msExchRecipientTypeDetails = $dirobj.get("msExchRecipientTypeDetails")
$msExchRemoteRecipientType = $dirObj.get("msExchRemoteRecipientType")
however the values of type System.__ComObject, how do i get the integer values.

Eric

Parents
  • This is interesting. I am seeing the same results and cannot seem to find a way to retrieve the values from the ComObject. Looks like these values may need to be retrieved via the QAD cmdlets, such as the following example:

    $dn = $DirObj.Get("distinguishedname")
    $objUser = Get-QADUser -Proxy -Identity $dn -IncludedProperties msExchRemoteRecipientType, msExchRecipientTypeDetails, mail
    
    $msExchRecipientTypeDetails = $objUser.msExchRecipientTypeDetails
    $msExchRemoteRecipientType = $objUser.msExchRemoteRecipientType

Reply
  • This is interesting. I am seeing the same results and cannot seem to find a way to retrieve the values from the ComObject. Looks like these values may need to be retrieved via the QAD cmdlets, such as the following example:

    $dn = $DirObj.Get("distinguishedname")
    $objUser = Get-QADUser -Proxy -Identity $dn -IncludedProperties msExchRemoteRecipientType, msExchRecipientTypeDetails, mail
    
    $msExchRecipientTypeDetails = $objUser.msExchRecipientTypeDetails
    $msExchRemoteRecipientType = $objUser.msExchRemoteRecipientType

Children