Platform SDK: Active Directory, ADSI, and Directory Services

Modifying Attributes with ADSI

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: