IADsCollection

The IADsCollection interface enables a dependent COM object to define and manage the logical grouping of arbitrary sets of named data elements in Active Directory. Collections differ from arrays of elements since individual items can be added or deleted without re-ordering the entire array.

Collection objects can represent one or more items that have no physical underlying existence in the directory. For example, a collection object can represent a list of print jobs in a queue or a list of active sessions connected to a server. The implementation of a collection object may also save its data to persistent storage.

To manage lists of Active Directory object references, for example, users in a specific group, use the IADsMembers.

IADsCollection supports no properties.

When to Implement

Implement IADsCollection only when you are providing an Active Directory implementation for your directory service.

When to Use

Use the IADsCollection methods when you manage sets of data elements of an arbitrary nature. Collection objects can be saved to persistent storage in the underlying directory service and so can be used to represent any arbitrary information represented in a single Automation Variant type format. Collections can also represent volatile information that has no correspondence to the underlying directory service (for example, a list of print jobs or a list of communications sessions active in a server).

When you need to manage a list of Active Directory object references, use IADsMembers. When you are working with Active Directory objects that contain other objects, for instance when working with the Active Directory hierarchical directory structure or the network topology, use IADsContainer.

Methods in VTable Order

IUnknown Methods Description
QueryInterface Returns pointers to supported interfaces.
AddRef Increments reference count.
Release Decrements reference count.

IDispatch Methods Description
GetTypeInfoCount Gets the number of type descriptions.
GetTypeInfo Gets a description of object's programmable interface.
GetIDsOfNames Maps name of method or property to DISPID.
Invoke Calls one of the object's methods, or gets/sets one of its properties.

IADsCollection Methods Description
get__NewEnum Get interface on an enumerator object.
Add Add an object to the collection.
Remove Remove an object from the collection.
GetObject Gets the specified item.

See Also

ADSI Collection Object, ADSI Enumerator Object