BUG: [Object].GUID Results Differ from [Object].Get("GUID")ID: Q215355
|
When attempting to retrieve a directory object's GUID from an LDAP directory, using [object].GUID produces different results than using [object].Get("GUID").
Because of a bug in the LDAP ADSI Provider that ships with ADSI 2.0, using the syntax [object].GUID returns the GUID for the Class object, whereas using the syntax [object].Get("GUID") returns the actual GUID of the object you are currently bound to.
When retrieving an object's GUID, use the Get() method to retrieve the attribute value as in this example:
[object].Get("GUID")
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
Dim adsRoot
Dim strLdapPath
strLdapPath = "LDAP://myserver:389/o=Microsoft/ou=Members/cn=MyUser"
'Bind to the object
Set adsRoot = GetObject(strLdapPath)
'Display a Message Box with the incorrect GUID attribute
Msgbox "The incorrect value is: " & CStr(adsRoot.GUID)
'Display a Message Box with the correct value
Msgbox "The correct value is: " & CStr(adsRoot.Get("GUID"))
'Clean up
Set adsRoot = Nothing
The documentation for Active Directory Services Interfaces can be found on the Microsoft Developer Network (MSDN).
For MSDN versions prior to the October 1998 update, use the following path:
Platform SDK \ Networking and Distributed Services \ Active Directory Services Interfaces version 2.0For the October 1998 version of MSDN, use the following path:
Platform SDK \ Networking and Distributed Services \ Active Directory
Additional query words:
Keywords : kbADSI
Version : winnt:2.0
Platform : winnt
Issue type : kbbug
Last Reviewed: March 26, 1999