Chapter 22. IADs and the Property Cache

Each object in a directory has a series of attributes, or properties, that uniquely define it. Although properties can vary from object to object, ADSI supports the manipulation of a core set of six properties common to all objects using the IADs interface. These properties are common to all objects because IADs is the most basic interface in ADSI.

The IADs Properties

The IADs properties are as follows:

Class

The object’s schema class

GUID

The object’s Globally Unique ID (GUID)

Name

The object’s name

ADsPath

The ADsPath to the object in the current namespace

Parent

The ADsPath to the object’s parent

Schema

The ADsPath to the object’s schema class

Each of these properties has a corresponding property method in the IADs interface. You can use the property method, which has the same name as the property, to access that property’s value. Example 22-1 contains code to display the six IADs properties for a user object.

Example 22-1. Using the explicit property methods to display the six IADs properties

Option Explicit Dim objUser 'An ADSI User object Dim str 'A text string ' User object using the LDAP namespace Set objUser = GetObject("LDAP://cn=Administrator,cn=Users,dc=mycorp,dc=com") str = str & "Name: " & objUser.Name & vbCrLf str = str & "GUID: " & objUser.GUID & vbCrLf str = str & "Class: " & objUser.Class & vbCrLf str = str & "ADsPath: " & objUser.ADsPath & vbCrLf str = str & "Parent: " & objUser.Parent & vbCrLf str = str & "Schema: " & objUser.Schema & vbCrLf ...

Get Active Directory, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.