IADs::PutEx

Uses the name of a property to save a single or multi-valued property into the property cache. This overwrites any value currently in the property cache. The values in the cache are not written to the underlying directory service until an IADs::SetInfo occurs.

HRESULT IADs::PutEx(
  LONG lnControlCode,  //Multi-value control code
  BSTR bstrName,       //Name of the property
  VARIANT vProp        //Value of the property
);
 

Parameter

lnControlCode
[in] Values for the control code indicate controls to be passed on to the underlying directory server. These controls do not operate on the property values in the property cache. For example, the control code setting ADS_PROPERTY_CLEAR means that when an IADs::SetInfo flushes the cache to the underlying DS, an ADSI provider-specific "Clear Property" command is passed on to the DS for the named property. If no SetInfo occurs, the property entry in the cache remains as is and subsequent GetInfo or GetInfoEx calls retrieve the contents of the property cache.

Values for the multi-value control code can be any of the following.

ADS_PROPERTY_CLEAR
Instruct the DS to remove the property from the object
ADS_PROPERTY_UPDATE
Instruct the DS to replaces the current value with the element(s) in the passed VARIANT array.
bstrName
[in] Name of the property as defined in the ADSI Schema Class Object for this object, for example "FullName".
vProp
[in] Value of the property.

Return Values

This method supports the standard return values E_FAIL and E_UNEXPECTED, as well as the following:

S_OK
The property value has been set successfully.

See Also

IADs::Get, IADs::GetEx, IADs::Put, ADSI Property Object, Property Cache