Put some error codes into the UDF and check whether the object is actually created successfully.
code:
$objRootDSE = GetObject("LDAP://rootDSE").Get("defaultNamingContext")
? 'Error = '+@ERROR+' - '+@SERROR

_________________________
There are two types of vessels, submarines and targets.