Platform SDK: Active Directory, ADSI, and Directory Services

IADsPropertyList

The IADsPropertyList interface is used to modify, read, and update a list of property entries in the property cache of an object. It serves to enumerate, modify and purge the contained property entries. You can use the enumeration method of this interface to find out all the initialized properties. This is different from using the schema to determine all possible attributes an ADSI object can have and which properties have been set.

Call the methods of the IADsPropertyList interface to examine and manipulate the property list on the client. Before calling the methods of this interface, you must call IADs::GetInfo or IADs::GetInfoEx explicitly to load the assigned property values of the object into the cache. After calling the methods of this interface, you must call IADs::SetInfo to save the changes in the persistent store of the underlying directory.

To obtain the property list of an ADSI object, you bind to its IADsPropertyList interface. You must call the GetInfo method before calling other methods of property list object, if the property cache has not been initialized. For examples, see the Example Code.

The IADsPropertyList interface inherits from IDispatch and exposes the following methods and property methods.

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 and sets one of its properties.

IADsPropertyList property methods Description
get_PropertyCount Gets the number of properties in the property list.
Next Gets the next item in the property list.
Skip Skips a specified number of items in the property list.
Reset Moves back to the start of the list.
Item Gets a property that is specified by name or by index.
GetPropertyItem Gets the value of a named property.
PutPropertyItem Puts the value of a named property.
ResetPropertyItem Resets the value of a named property.
PurgePropertyList Deletes all properties from the list and, therefore, releases the property caches as well.

Example Code [Visual Basic]

The following Visual Basic code snippet shows how to bind to the IADsPropertyList interface and then initialize the property cache.

IADsPropertyList pList
Set pList = GetObject("LDAP://dc01/dc=Microsoft,dc=com")
pList.GetInfo

Example Code [C++]

The following C++ code snippet shows how to bind to the IADsPropertyList interface and initialize the property cache.

IADsPropertyList* GetPropertyCache(LPWSTR adsPath)
{
    IADsPropertyList *pList;
    IADs *pObj;
    HRESULT hr = ADsGetObject(adsPath,
                          IID_IADsPropertyList,
                          (void**)&pList);
    // initialize the property cache
    hr = pList->QueryInterface(IID_IADs,(void**)&pObj);
    pObj->GetInfo();
    pObj->Release();
 
    // get the property list.
    hr = pObj->QueryInterface(IID_IADsPropertyList,(void**)&pList);
    pObj->Release();
 
    return pList;
}

Requirements

  Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with DSClient).
  Windows 95/98: Requires Windows 95 or later (with DSClient).
  Header: Declared in Iads.h.

See Also

IADs::GetInfo, IADs::GetInfoEx, IADs::SetInfo, IADsPropertyList Property Methods, IDispatch