I have this VBS script which works:
code:
'''''''''''''''''''''''''''''''''''''''
'Bind
'''''''''''''''''''''''''''''''''''''''
Set user = GetObject("LDAP://amdc005/OU=1114, OU=NCS,OU=Organizations,DC=us,DC=tycoelectronics,DC=com")
user.GetInfoEx Array("canonicalName"), 0
count = user.PropertyCount
strText = "Canonical Name: " & user.Get("canonicalName") & " Count of properties in cache" & count
If (Err.Number <> 0) Then
BailOnFailure Err.Number, "on Get method"
End If
show_items strText, sComputer

'''''''''''''''''''''''''''''''''''''''
'Display subroutines
'''''''''''''''''''''''''''''''''''''''
Sub show_items(strText, strName)
MsgBox strText , vbInformation, "Get canonicalName"
End Sub

Sub BailOnFailure(ErrNum, ErrText) strText = "Error 0x" & Hex(ErrNum) & " " & ErrText
MsgBox strText, vbInformation, "ADSI Error"
WScript.Quit
End Sub

and this KiXtart script which does not:


? $item2 = GetObject("LDAP://amdc005/CN=HELTZELK,OU=1114, OU=NCS,OU=Organizations,DC=us,DC=tycoelectronics,DC=com")
? "Getobject: @error @serror"

$item2.GetInfo
$count = $item2.PropertyCount
? "Count: $count"

Dim $attrib[0]
$attrib[0] = "canonicalName"
$item2.GetInfoEx($attrib, 0)
? "GetInfoEx: @error @serror"
$count1 = $item2.PropertyCount
? "Count: $count1"
$canonicalName = $item2.get("canonicalName")
? "Get: @error @serror"
? vartypename($canonicalName)


It appears that the GetInfoEx method does not return an error but does not repopulate the property cache.
_________________________
Home page: http://www.kixhelp.com/hb/