IADsCollection::Add method (iads.h)

The IADsCollection::Add method adds a named item to the collection.

Syntax

HRESULT Add(
  [in] BSTR    bstrName,
  [in] VARIANT vItem
);

Parameters

[in] bstrName

The BSTR value that specifies the item name. IADsCollection::GetObject and IADsCollection::Remove reference the item by this name.

[in] vItem

Item value. When the item is an object, this parameter holds the IDispatch interface pointer on the object.

Return value

This method supports the standard return values, as well as the following.

For more information and other return values, see ADSI Error Codes.

Remarks

Collections for a directory service can also consist of a set of immutable objects.

This method is not supported in any of the ADSI system providers.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header iads.h
DLL Activeds.dll

See also

ADSI Error Codes

ADSI System Providers

IADsCollection

IADsCollection::GetObject

IADsCollection::Remove

IDispatch