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. Use the enumeration method of this interface to identify initialized properties. This is different from using the schema to determine all possible attributes that 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, 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.

Methods in Vtable Order

The IADsPropertyList interface inherits the methods of the standard COM interfaces:

In addition, IADsPropertyList defines the following methods.

Method 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.

Properties

The IADsPropertyList interface defines the following property. The preceding table includes an access method for this property.

Property Description
PropertyCount Gets the number of properties in the property list.

Example Code [Visual Basic]

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

Dim pList as IADsPropertyList
On Error GoTo Cleanup

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

Cleanup:
	If (Err.Number<>0) Then
		MsgBox("An error has occurred. " & Err.Number)
	End If
	Set pList = Nothing

Example Code [C++]

The following code example shows how to bind to the IADsPropertyList interface and initialize the property cache.

IADsPropertyList* GetPropertyCache(LPWSTR adsPath)
{
	IADsPropertyList *pList;
	IADs *pObj;
	if(!adsPath)
	{
		_tprintf(TEXT("Invalid ADsPath."));
		return NULL;
}

	HRESULT hr = ADsGetObject(adsPath,
						IID_IADsPropertyList,
						(void**)&pList);
	// Initialize the property cache.
	hr = pList->QueryInterface(IID_IADs,(void**)&pObj);
	pObj->GetInfo();
	pObj->Release();

	return pList;
}

Requirements

Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Iads.h.

See Also

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