The VARIANT that contains the index or name of the property to be retrieved.
Address of a caller-allocated VARIANT variable. On return, the VARIANT contains the IDispatch pointer to the object which implements the IADsPropertyEntry interface for the attribute retrieved.
This method supports the standard HRESULT return values, including S_OK. For more information and other return values, see ADSI Error Codes.
You must clear pVariant using VariantClear when the value returned by the Item method is no longer required.
The following code example shows how to enumerate all the entries with the Item method.
Dim propList As IADsPropertyList
Dim propEntry As IADsPropertyEntry
Dim count As Long
On Error GoTo Cleanup
Set propList = GetObject("LDAP://dc02/DC=Fabrikam,DC=com")
count = propList.PropertyCount
Debug.Print "No of Property Found: " & count
'==== Getting the property list item with Name ==================
Set propEntry = propList.Item("uSNCreated")
' to examine property entries by name and type
For i = 0 To count - 1
'==== Getting the property list item with Number =============
Set propEntry = propList.Item(i)
If (Err.Number<>0) Then
MsgBox("An error has occurred. " & Err.Number)
Set propList = Nothing
Set propEntry = Nothing
The following code example shows how to retrieve the Owner property of a computer using the IADsPropertyList::Item method. For more information about the GetPropertyCache function and a code example, see IADsPropertyList.
The feedback system for this content will be changing soon. Old comments will not be carried over. If content within a comment thread is important to you, please save a copy. For more information on the upcoming change, we invite you to read our blog post.