Platform SDK: Active Directory, ADSI, and Directory Services |
ADSI provides two methods for modifying attribute data: IADs::Put and IADs::PutEx. These methods modify the data on the client-side cache. You must use IADs::SetInfo to commit the changes. SetInfo is always an explicit call, it is never called implicitly.
Note In Active Directory, attribute modifications are transacted. For example, if you modify the sn and givenName attributes, and clear the telephoneNumber attribute of a user object, the changes are committed all at once when you call SetInfo.
Put takes an attribute name and a variant parameter. You can use this method to set attributes that contain both single and multiple values.
PutEx gives you control over operations on attributes with multiple values. You may append, delete, update, and clear existing values. PutEx always expects a variant array of attribute values. However, you can use this method to set an attribute with a single value as well.
PutEx uses the following control operations:
Clears the attribute's value. After the operation, the attribute does not have any value.
Replace the current value (or NULL value) with these values. This is the same behavior as Put.
Append the existing value with these values. If the current value is NULL, it has the same effect as ADS_PROPERTY_UPDATE.
Delete the values that match these values. This is different than ADS_PROPERTY_CLEAR. After the delete operation, the attribute may or may not have values.