I really think that the issue is with KiXtart COM & GetInfoEX. this is demonstrated by the fact that the property cache is NOT overwritten in my example code. The count of 33 (IIRC) values from GetInfo should be reduced to 1 if GetInfoEx actually worked.
quote:
Non-stored, constructed properties
A user object also has constructed properties that are not stored in the directory but are calculated by the domain controller (such as canonicalName, distinguishedName, allowedAttributes, ADsPath, and so on). Note that distinguishedName and ADsPath are not defined in the schema. All the constructed properties can be retrieved by IDirectoryObject and IDirectorySearch methods. Most are automatically retrieved and cached with a IADs::GetInfo call on the user object (Note IADs::Get does an implicit IADs::GetInfo call if the cache is empty). However, some constructed properties are not and therefore require a IADs::GetInfoEx call to explicitly retrieve them. For example, canonicalName is not retrieved with a IADs::GetInfo call and therefore IADs::Get will return a E_ADS_PROPERTY_NOT_FOUND error and enumeration of all properties using IADsPropertyList will not include the canonicalName property.
quote:
Example Code for Reading a Constructed Property
[This is preliminary documentation and subject to change.]
The following code fragments read the canonicalName property of the Administrator.
code:
'Read the canonicalName of Administrator
Dim rootDSE As IADs
Dim user As IADs
sPrefix = "LDAP://"
Set rootDSE = GetObject(sPrefix & "rootDSE")
If (Err.Number <> 0) Then
BailOnFailure Err.Number, "on GetObject method"
End If
sDomain = rootDSE.Get("defaultNamingContext")
If (Err.Number <> 0) Then
BailOnFailure Err.Number, "on Get method"
End If
sUserDN = "cn=Administrator,cn=users," + sDomain
'''''''''''''''''''''''''''''''''''''''
'Bind to the Administrator user
'''''''''''''''''''''''''''''''''''''''
Set user = GetObject(sPrefix & sUserDN)
user.GetInfoEx Array("canonicalName"), 0
strText = "Canonical Name: " & user.Get("canonicalName")
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 for Administrator"
End Sub
Sub BailOnFailure(ErrNum, ErrText) strText = "Error 0x" & Hex(ErrNum) & " " & ErrText
MsgBox strText, vbInformation, "ADSI Error"
WScript.Quit
End Sub
[ 28. August 2003, 15:19: Message edited by: Howard Bullock ]