|
|
|||||||
Anyone have a clue on this? Trying to PutEx an extra E-mail address in Exchange as follows: code:Why does the PutEx fail?$Server="Serverx" Any thoughts welcome [ 09. September 2003, 14:23: Message edited by: Chris S. ] |
||||||||
|
|
|||||||
fail with what error code? |
||||||||
|
|
|||||||
"$ObjUser.PutEx" fails with a returncode of "1" "$ObjUser.SetInfo" suceeds with a returncode of "0" IADs::PutEx syntax: PutEx(Long, BStr, Variant) Could the "Long" or "BStr" be the problem (all Kix variables = Variant) ? |
||||||||
|
|
|||||||
I would try this simple change to your line: code:anyway, I must wonder.$ObjUser.PutEx(3,"otherMailbox",$NewMail[0]) @Error ? objects about never give real errors. this says it straight though. it doesn't like PutEx |
||||||||
|
|
|||||||
No, dosn't work either - returns "1". I tried this: code:Epl.: Retreiving the original E-Mail Addresses Array, and adding the New Mail Address, then replacing the whole thing with PutEx(2,...).$Server="Serverx" This is accepted (returncode 0), however in Exchange the added E-Mail Address is listed as: ???????k (with no message type). Logging reveals: "LDAP modify request contains value CCMAIL$Test, Userx at Sitex." "LDAP modify request contains value MS$Orgx/Sitex/Userx." "LDAP modify request contains value 浳灴砤䁸整瑳搮k." From last log line it appears there are somthing wrong in the valuetype passed What on earth... [ 09. September 2003, 14:22: Message edited by: Chris S. ] |
||||||||
|
|
|||||||
ok, can I ask you from now start using the code-tags when you post code. it rather hard to find your comments in the midst ok, how come you assume or know the putEx takes the e-mail addy as array? anyway, this: code:seems to me just the same as:$OMailbox=$ObjUser.GetEx("otherMailbox") code:$OMailbox=$ObjUser.GetEx("otherMailbox") |
||||||||
|
|
|||||||
1. I base the assumption on several VBS codesamples, here is one from the ADSI SDK: quote:2. Your right, it appears the same, however some difference must exist in the stored string format, as the first 2 elements in the array are accepted and the third appears as garbage. I guess getting the array preserves the stringformat if you don't mess with it. Listing the VarType() for each element gives 8 (string) for all elements, including the added one (Ruud?). Sorry obout the quoting |
||||||||
|
|
|||||||
Sorry again Answer to your second question: 2. Yes it's the same (and generates same error) |
||||||||
|
|
|||||||
could you try with this piece and say does they all look code:not sure but think it comes to com-object arrays...$ObjUser=GetObject("LDAP://"+$Server+"/CN="+$User+",CN=Recipients,OU="+$Site+",o="+$Org) try it out but might be you need to find another way to do this |
||||||||
|
|
|||||||
second question. you mean the code? wasn't a question |
||||||||
|
|
|||||||
Produces: quote: |
||||||||
|
|
|||||||
ok. then, say how this does work: code:btw, I see you found the quote-button$ObjUser=GetObject("LDAP://"+$Server+"/CN="+$User+",CN=Recipients,OU="+$Site+",o="+$Org) willing to try the code-button too? [ 09. September 2003, 12:24: Message edited by: Lonkero ] |
||||||||
|
|
|||||||
(Added a .SetInfo) The PutEx is accepted. In Exchange the added address is: ???????k. Logging reveals same garbage as before instead of proper E-mail Address. |
||||||||
|
|
|||||||
dude... you could try outputting a mailbox which already has an smtp addy. to see do we have the correct format at all. |
||||||||
|
|
|||||||
Yes, already did. When failing I don't thrust books, however in this case the book format and the real life format matches. Only not the PutEx (found the gremlins as well) |
||||||||
|
|
|||||||
k, finally bothered looking at msdn. this is vbs sample: quote:like you see, the addresses are not put in with putEx() do you have a sample link that does it with that? |
||||||||
|
|
|||||||
You have the reference in your very first line: quote:The quote:sets the primary E-mail Address (return address), "otherMailbox" sets additional E-mail Addresses (and that is what I need) |
||||||||
|
|
|||||||
well, according to the documentation, the "aothermailbox" is just a bogus null. there is nothing passed with it. |
||||||||
|
|
|||||||
Please review this post. http://aspn.activestate.com/ASPN/Mail/Message/278010 Could this be part of your issue? I can put this into KiXtart terms if you believe you have the same issue. |
||||||||
|
|
|||||||
LK: The documentation is quit scarce and from time to time contradictionary and gives no insight. The working examples are the ones to learn from. As I can GetEx "otherMailbox", it can't be all bogus. I can PutEx as well, it only, for some reason, passes garbage to the PutEx method, when I populate the elements my self, but not if I pass the previously GetEx'ed values HB: Yes, it's the exact same thing I am trying to accomplish. I'm not fluent in Perl, so your translation is appreciated. |
||||||||
|
|
|||||||
$NewMail[0]="smtp$$xx@@test.com" What is "$$xx" in the above string? Does this translate to smtp:user@test.com? I know the double @'s are correct. The Perl example deals with the data being return as a single value or as an array if multiple values exist. In all cases the code rebuilds the array to write back to the property. I am a little confused by your last post. Before we get into all that thought. Do you have any existing data in this property alreadt on any mailboxes? If yes, can you succesfully extract the data? If no, can you add some data via the Exchange admin program to test reading the data? [ 09. September 2003, 17:08: Message edited by: Howard Bullock ] |
||||||||
|
|
|||||||
On a test mailbox can you get the following to work to replace what is there or to add the first item? $ObjUser.PutEx(2,"otherMailbox",$NewMail) @Error ? |
||||||||
|
|
|||||||
Also what version of KiXtart are you using? Try: Dim $NewMail[0] instead of $NewMail[1] |
||||||||
|
|
|||||||
1. The E-mail Addresses (otherMailbox) syntax = smtp$user@test.com In Kix entered as: "smtp$$user@@test.com" (tried "smtp"+"$$"+"user@@test.com" with same result). Yes it translates to: smtp$user@test.com 2. I have existing X400, SMTP Primary, MS and CCMail addresses, and want to add one or more secondary SMTP Addresses. 3. Yes, I can sucessfully retreive the data to an array with a GetEx statement. I can even add the same array back, as long as I dosn't add to or modify anything in the array. |
||||||||
|
|
|||||||
If you can use PutEx(2,... You may be able to get the $oldarray, for each item in $oldarray build a $newarray Then PutEx(2, "otherMailbox", $newarray) |
||||||||
|
|
|||||||
Tried the "Dim $NewMail[0]" It made a difference; now the PutEx is accepted (returncode 0), however the value entered into Excange Admin is: ???????k (with no mailtype) From logging: "LDAP modify request contains value 浳灴砤䁸整瑳搮k. " How come $NewMail is passed as garbage? To me it looks like ADSI is expecting a reference to the elements in the array rather then the strings itself?! Kixtart is ver. 4.02 Running on a NT 4.0 server with ADSI Provider 2.5. Tried running from a Win2K pro with same result. |
||||||||
|
|
|||||||
KiXtart 4.02 has some COM issues. Please try again with 4.21. Have you tried using PutEx (2, ... instead putEx(3, ...? [ 09. September 2003, 17:44: Message edited by: Howard Bullock ] |
||||||||
|
|
|||||||
1. Tried Ver 4.21, and even 4.22 RC, - same result 2. Tried PutEx(2...), it replaces first mail entry (ccmail) with: "???????k" |
||||||||
|
|
|||||||
Sorry to say I am at a loss at this point. I do not have a test exchange environment with which I can try this. I know that GetInfoEx had problems and will be fixed in the production release of 4.22. Maybe there are some other PutEx issues as well. In the past I was able to successfully use PutEX with Perl. So maybe this is a KiXtart issue. Can anyone get this to work with KiXtart or replicate the failure? |
||||||||
|
|
|||||||
Found this at MSDN (Active Directory Services Interface in the Microsoft Exchange 5.5 Environment): code:I tried CStr'ing the E-Mail string before PuEx'ing it to no avail.Note that in VBScript, it is necessary to CStr() string values Can anyone figure out if the: quote:and the: quote:makes an issue in Kix? |
||||||||
|
|
|||||||
heh, you found the very same topic I cut the code from. but like said before, do you find the initialization of the aothermailbox in this code? not. there is no such var, nor even string. so, actually this code from msdn shouldn't work either. |
||||||||
|
|
|||||||
In the "Mail-Recipient (person) Object Class" Table, in the "Exchange Name" Column, is listed: "Proxy-Addresses" The corresponding "LDAP Name" Column lists: quote:And the corresponding "Comment" Column says: quote:Furthermore it is used 4 times in the examples. I agree it's wake, but it's there, and it works (this is the level of documentation I have come to expect, dealing with M$ technologies ) |
||||||||
|
|
|||||||
I had the same issue trying to update a custom attribute for a product called DirectorySmart. I found no way thru Kixtart to successfully use .putex, but I did come up with a work-around. The workaround involves the creation of a temporary VBscript, and the execution of this script. See the example below: code:Hope this helps |
||||||||
|
|
|||||||
hmm... you might want to wait on the 4.22 final of kixtart or the next RC. there is at least one com-related bug fixed... lets see what it does. |
||||||||
|
|
|||||||
Thank's MA, it's a great suggestion. Since I'm coding for a NT platform, it requires VBS installed, and then I might as well do the whole thing in VBS where it's known to work. However it got around the failure; Luckily you can create an import file and import it to Exchange. I created an importfile with the new addresses, and then made the script import the file to Exchange, - it works. Thank's to all for chippin in. |
||||||||
|
|
|||||||
uhm. did I read right. you made the hardest thing (making of the csv) by hand and then the easy part of importing you scripted? |
||||||||
|
|
|||||||
The whole task was; To change Exchange mail aliases and add a secondary E-mail address with the new alias, then adjust the SAM/loginname accordingly. An input file lists current an new aliases. I did all the tasks that was possible by ADSI (LDAP:/WinNT:). Since I could not PutEx the new E-mail addresses (as Exchange requires), the script writes them to a CSV Import file, which the script subsequently commands Exchange to import. Best regards. |
||||||||
|
|
|||||||
Just curious: when was this fixed? and what was the problem? cause I was fighting the whole day with kix 4.21 with this same problem, and only now, at this non work hour i came up with the brilliant idea of trying it on kix 4.23.. and behold.. it works.. so.. enlighten me...what was wrong in previous versions? |
||||||||
|
|
|||||||
It was fixed in 4.22. See these thread for more info. http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB3&Number=79478 http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB3&Number=79473 http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB2&Number=76258 |