Platform SDK: Active Directory, ADSI, and Directory Services |
The methods of the IADsMembers interface read and write the properties described in this topic. For more information see Interface Property Methods.
Property | Description |
---|---|
Count
[Visual Basic] [C++] |
Indicates the number of items in the container. If the filter is set then count returns only the number of items that fit the filter description. |
Filter
[Visual Basic] [C++] |
Indicates the filter. The syntax of the entries in the filter array is the same as the Filter used on the IADsContainer interface. |
The ADSI system providers do not support the IADsMembers::get_Count property method.
The following Visual Basic code snippet provides an example of using the property methods of this interface.
Dim grp as IADsGroup Set grp = GetObject("WinNT://myComputer/someGroup") grp.members.filter = Array("user") For each usr in grp.members MsgBox usr.Name & "," & usr.Class & "," & usr.AdsPath Next
The following C++ code snippet uses the IADsMembers::get_Filter method to select the collection of users.
IADsGroup *pGroup; HRESULT hr; LPWSTR grpPath = L"WinNT://myComputer/someGroup"; hr = ADsGetObject(grpPath,IID_IADsGroup,(void**)&pGroup); if(FAILED(hr)) exit(hr); IADsMembers *pMembers; hr = pGroup->Members(&pMembers); if(FAILED(hr)) exit(hr); hr = pGroup->Release(); SAFEARRAY *sa = CreateSafeArray(L"user"); hr = pMembers->put_Filter(sa); hr = EnumMembers(pMembers); // See code snippet in // IADsMembers::get__NewEnum. if(pMembers) pMembers->Release();
IADsContainer, IADsMembers::get__NewEnum, IADsMembers, Interface Property Methods