An ADSI Enumerator Object is a dependent COM object in Active Directory that enumerates its Active Directory host object. ADSI Container Objects, ADSI Members Objects, and ADSI Collection Objects host enumerator objects. This object supports the Automation IEnumVARIANT interface, which is retrieved by the get__NewEnum ( _NewEnum) method supported by IADsContainer, IADsMembers, and IADsCollection. By convention, all items managed by an enumerator object are of the same Automation data type. An enumeration should not retrieve some items as VARIANTs of type VT_I4 and others as VARIANTs of type VT_BSTR. Active Directory objects interfaces are represented by the VT_UNKNOWN type.
Implement ADSI Enumerator Object only when you are providing Active Directory enumeration functionality for your directory service implementation.
Follow one of three models for caching collections during enumeration. The caching model affects the behavior of Active Directory when an object in a collection is deleted from the underlying directory service "outside" of Active Directory.
ADSI Container Object or ADSI Members Object enumerations yield one or more Active Directory interfaces. Cache the retrieved pointers for any Active Directory objects you intend to manipulate to avoid the overhead of obtaining a new interface pointer. For example, a Visual Basic program that enumerates a container and populates a listbox with names can cache the interface pointers associated with the names for later use. This approach provides greater performance than populating the listbox during enumeration and obtaining a new interface pointer when the user makes a selection.
Interfaces on ADSI Enumerator Object | Description |
---|---|
IUnknown | Universal COM object management and interface query methods. |
IDispatch | Automation methods for late-bound access to an object's methods and properties |
IEnumVARIANT | Iteration methods for stepping through the items in a container. |
Windows NT: Use version 4.0 and later.
ADsBuildEnumerator, ADsEnumerateNext, ADsFreeEnumerator