Page 1 of 1 1
Topic Options
#79778 - 2003-09-10 03:50 PM $Obj.PutEx issue ?
IRa Offline
Fresh Scripter

Registered: 2003-09-09
Posts: 28
Loc: Denmark
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.

Top
#79779 - 2003-09-12 08:39 AM Re: $Obj.PutEx issue ?
Ruud van Velsen Moderator Offline
Developer
*****

Registered: 1999-05-06
Posts: 391
Loc: Amsterdam, The Netherlands
Hi Ira,

thanks for the report. This is caused by the same bug responsible for: Topic: COM Bug still unresolved in 4.22rc1

This is fixed in the final build. If you are interested, please send me a private email, and I will get you a build to test with.

Thanks again,

Ruud

Top
#79780 - 2003-09-12 05:41 PM Re: $Obj.PutEx issue ?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ja!
see IRA!
was fixed before you even found it [Wink]
_________________________
!

download KiXnet

Top
#79781 - 2003-09-12 06:18 PM Re: $Obj.PutEx issue ?
IRa Offline
Fresh Scripter

Registered: 2003-09-09
Posts: 28
Loc: Denmark
Impressive; Ruud, give your self a pat on you back.
Top
Page 1 of 1 1


Moderator:  ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2141 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.037 seconds in which 0.019 seconds were spent on a total of 12 queries. Zlib compression enabled.