Ruud

I'm bringing this to your attention, as it might be an issue. Noone seems to have a clue, however it might stem from lack of (my) knowledge.

Trying to use the obj.PutEx (ADSI IADs::PutEx) method to populate the Exchange Server otherMailbox property as follows:
code:
$ObjUser=(LDAP://Serverx/CN=Userx,CN=Recipients,OU=Sitex....)

Dim $NewSMTPMail[0]
$NewSMTPMail[0]="SMTP$$USerx@@dom.com"
$Ret=$ObjUser.PutEx(3,"otherMailbox",$NewSMTPMail)

What happens is, that ADSI forms a perfect LDAP Modify Request, however with garbage data ( 浳灴砤䁸整瑳搮k). This is accepted in Exchange as: "???????k".

The funny part is that I can GetEx the elements of otherMailbox and PutEx it back with no problem.

If I try to GetEx the elements, add the NewSMTPMail as an extra element and then PutEx it back, it writes the original GetEx'ed elements with no problem, the added extra element is however garbage.

This works:
code:
$ObjUser=(LDAP://Serverx/CN=Userx,CN=Recipients,OU=Sitex....)

$OtherMailbox=$ObjUser.GetEx("otherMailbox")
$Ret=$ObjUser.PutEx(2,"otherMailbox",$OtherMailbox)

This dosn't work:
code:
$ObjUser=(LDAP://Serverx/CN=Userx,CN=Recipients,OU=Sitex....)

$OtherMailbox=$ObjUser.GetEx("otherMailbox")

Redim Preserve $OtherMailbox[UBound($OtherMailbox)+1]
$OtherMailbox[UBound($OtherMailbox)]="SMTP$$USerx@@dom.com"

$Ret=$ObjUser.PutEx(2,"otherMailbox",$OtherMailbox)

I can list all elements GetEx'ed from otherMailbox, and VarType lists 8 as the subtype for all elements.

It appears to me that Kix passes a wrong string format to ADSI when you use PutEx, but only for stringvalues generated in Kix.
Apparently the correct string format is preserved when you GetEx some data and PutEx it back again without messing with it.

Ver 4.02, 4,21 and 4.22 RC all shows same problem.