Originally Posted By: sb1920alk

....
My script is test2.kix:
 Code:
messagebox(ReadNC(%computername%),"")
Function ReadNC( ServerName )
  $ReadNC = ""
  $Root = GetObject( "LDAP://" + ServerName + "/rootDSE" )
  If @ERROR = 0
     $ReadNC = $Root.defaultNamingContext
  Endif
EndFunction

When I run kix32.exe test2.kix, I get
ERROR : error in parameterdefinition of [readnc]!
Script: C:\...path to test file...test2.kix
....


You have just one parameter in your function and when you call it you sue two parameters. That’s why you get that error message. Instead of %computername% you can also use @WKSTA. @WKSTA is a macro build into kix and gets filled with the name of the current computer.

 Originally Posted By: sb1920alk

....
Here is a script I'm trying to convert to KIX from vbscript.
 Code:
Set $objItem = GetObject("LDAP://***Distinguised User Name***")
$msExchHomeServerName = $objItem.msExchHomeServerName
$EmailServer = Right($msExchHomeServerName,Len($msExchHomeServerName) - InstrRev($msExchHomeServerName,"="))
MessageBox($EmailServer,"")


When I run it, the error message is:
ERROR : IDispatch pointers not allowed in expressions!
Script: C:\...path to test script
Line : 2

...not sure what's going on.


When you do a VarTypeName of $EmailServer I guess you will get some kind of array. What happens if you use $EmailServer[0]?
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.