Page 1 of 1 1
Topic Options
#76502 - 2003-08-26 05:11 PM COM Bug - ADSI GetInfoEx
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
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/

Top
#76503 - 2003-08-26 05:12 PM Re: COM Bug - ADSI GetInfoEx
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Well it does have a script in the post... Move to COM forum please.

[ 26. August 2003, 18:53: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#76504 - 2003-08-26 07:13 PM Re: COM Bug - ADSI GetInfoEx
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I cant get this to work in Kixtart. imho, this should be a simple convert, but cant understand why GetInfoEx isn't populating the cache. Almost as if there is something buggy about the array being passed ... recommend you flag this as a bug in the beta forum.

Has anyone else been trying ? Comments ?

-Shawn

Top
#76505 - 2003-08-26 07:17 PM Re: COM Bug - ADSI GetInfoEx
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Looks like we have all been down this road before:

http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=13;t=000133#000025

Still think its a bug though.

-Shawn

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 369 anonymous users online.
Newest Members
rrosell, PatrickPinto, Raoul, Timothy, Jojo67
17877 Registered Users

Generated in 0.105 seconds in which 0.077 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org