|
|
|||||||
Hi, Can see several have had problems with IDispatch pointers not allowed in expressions! But I've been unable to find any solutions. Here's my code: FUNCTION mailbox($getou) $mailbox=GETOBJECT("LDAP://$getou") ? "getobj @serror" ? "User Information:" ? "Display Name: " $mailbox.get("cn") ? "Given Name: " $mailbox.get("givenname") ? "Last Name: " $mailbox.get("sn") ? "Alias: " $mailbox.get("uid") ENDFUNCTION FUNCTION getOU($userName) DIM $dn,$objRootDSE,$strDomain DIM $objConnection,$objCommand DIM $objRecordSet $getOU = "Not Found" $objRootDSE = GETOBJECT("LDAP://RootDSE") $strDomain = $objRootDSE.Get("DefaultNamingContext") $objConnection = CREATEOBJECT("ADODB.Connection") $objConnection.Open ("Provider=ADsDSOObject;") $objCommand = CREATEOBJECT("ADODB.Command") $objCommand.ActiveConnection = $objConnection $objCommand.CommandText = "<LDAP://" + $strDomain + ">;((saMAccountName=" + $userName + "))" + ";distinguishedName,name;subtree" $objRecordSet = $objCommand.Execute WHILE Not $objRecordSet.EOF $dn = $objRecordSet.Fields("distinguishedName").Value $getOU = $dn $objRecordSet.MoveNext LOOP mailbox($getou) ENDFUNCTION BREAK on ? "Enter username: " GETS $username getOU($username) Hope someone can help me |
||||||||
|
|
|||||||
this is normally caused by 'unassigned' COM method calls Can't test this currently but try to assign a dummy var to some of your calls. ie. $nul = $objConnection.Open ("Provider=ADsDSOObject;") |
||||||||
|
|
|||||||
well, you should help us help you by telling us the whole error text. the idispatch is normally indeed caused by lazy or careless coding that feeds objects to the console. |
||||||||
|
|
|||||||
That's the hole error text I have given you. It's stops with last line in the function mailbox, but if I comment the line, it just moves up a line. I've tried to comment everything except the first "$mailbox=GETOBJECT("LDAP://$getou")" and I stille got the error Hope this answers your question |
||||||||
|
|
|||||||
Btw, " "getobj @serror"" says it's successfully Jan |
||||||||
|
|
|||||||
what version of kixtart you are using? I know that if I get error in my script, the error says on what line that happens. |
||||||||
|
|
|||||||
Did you try like Jochen said, suppressing the return obj in this line here. Think this would indeed cause some trouble: $nul = $objConnection.Open ("Provider=ADsDSOObject;") |
||||||||
|
|
|||||||
Yes I tried but it didn't fixed my problem |
||||||||
|
|
|||||||
I'm using ver 4.21. It does say which line the problem is, but if I comment that line the problem move 1 line up until I have comment every line then it does give any errors |
||||||||
|
|
|||||||
IIRC there was an IDispatch problem with that version. What happens if you run this with V. 4.22 ? |
||||||||
|
|
|||||||
hmmm, think it might be this: In your GetOU function, at the end, your making a call to this function: mailbox($getou) If you look, you will see that this function returns an object: $mailbox=GETOBJECT("LDAP://$getou") And you don't "silence" that return value in getou(), like this: $= mailbox($getou) Try that. -Shawn |
||||||||
|
|
|||||||
Hi, If I run 4.22 I get this error: In-page IO exception occurred. This type of exception is thrown by the Windows Memory Manager when it fails to (re)read code from the KiXtart executable. Common causes for this exception include: -running WKIX32 from a batchfile without using START /w -forced redirection of the network drive from which KiXtart was started -severe network errors/latency -faulty anti-virus software If I use wkix32 I get the same "IDispatch pointers not allowed in expressions!" error in a window |
||||||||
|
|
|||||||
Try this mailbox() function. Right now you are assigning the return value of the mailbox function to that object. I just changed it to be a local var. I think this what you meant to do. Code:
|
||||||||
|
|
|||||||
I guess Shawn wins the Goose this time |
||||||||
|
|
|||||||
Hi, I get the same error :-( Now Itried to run it in debug mode and to my big surprise the gives the error when doing DIM.....: DIM $dn,$objRootDSE,$strDomain DIM $objConnection,$objCommand When it DIM's the secondline I get the error: In-page IO exception occurred. This type of exception is thrown by the Windows Memory Manager when it fails to (re)read code from the KiXtart executable. Common causes for this exception include: -running WKIX32 from a batchfile without using START /w -forced redirection of the network drive from which KiXtart was started -severe network errors/latency -faulty anti-virus software If I use Wkix32 it works What is the different between kix32 and wkix32? |
||||||||
|
|
|||||||
Me thinks you have a corrupt kix32.exe, try re-downloading the latest and try again. Did I hear something about a goose ? |
||||||||
|
|
|||||||
I did a re-download and I got the same problem. Tried to download the latest devel. build, but that's a dead link It seems that it doesn't likes my DIM's in the function "getOU" and that's a new problem "Help me! Obi-Wan-Kenobi" |
||||||||
|
|
|||||||
Either this (not) or he runs Norton Antivirus |
||||||||
|
|
|||||||
It's WORKING!!!!! I just rebooted my pc. Must be something with my McAfee that did something crappy because it was stopped working and after I rebooted it worked again and now I could run the scripts Thanks a lot for your help. You are all my heros |
||||||||
|
|
|||||||
Cannot test here (don't have the infrastructure), but try this: Code: Break ON |
||||||||
|
|
|||||||
Well, I ran your script here (granted, i am using the latest 4.50 alpha build) but got this as output: E:\>kix32 t Enter username: shawn.tassie getobj The operation completed successfully. User Information: Display Name: Shawn.Tassie Given Name: Shawn Last Name: Tassie Alias: CN=Shawn.Tassie,OU=BCCS Dev Users,OU=Bell Users,OU=Bell,OU=Business Units ,DC=belldev,DC=***,DC=***,DC=** E:\> |
||||||||
|
|
|||||||
Its working! Great to hear. Good co-operative effort by all involved. Still want the goose though. Can somebody please give me the goose ? ;0) |
||||||||
|
|
|||||||
*sssht he said it's working now |
||||||||
|
|
|||||||
First sheep, and now goose... |
||||||||
|
|
|||||||
baaaaaaah |
||||||||
|
|
|||||||
weirdly enough, I got this in page [censored] today too! and if that wasn't enough, on not crashing run kixtart errors from registry write as "system can't find the file specified" doh. |
||||||||
|
|
|||||||
Just for the fun of dragging up an old subject I get the same error using ADODB.Connection Here's my code Code: $cmd = 'Driver={MySQL ODBC 3.51 Driver};Option=16387;Server=127.0.0.1;uid=admin;pwd=pass1;' $cn = CreateObject("ADODB.Connection") $cn.Open($cmd) ? $cn.State $cn.Execute("DROP DATABASE test") $cn.Close $cn = "" If I use $=$cn.Execute("DROP DATABASE test") The error is suppressed, however I feel that this error shouln't come up in the first place. (using kix 4.60) |
||||||||
|
|
|||||||
Oh yeah I forgot: |