Re: Reducing ADAM Accesses
- From: "Joe Kaplan" <joseph.e.kaplan@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 14 Feb 2007 12:43:10 -0600
Have you looked at the ADAM tokenGroups attribute on RootDSE?
Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"Phran" <Phran@xxxxxxxxxxxxxxx> wrote in message
news:E517F220-2215-4955-8B49-FE6E89F8ED99@xxxxxxxxxxxxxxxx
Hello, I have a question about reducing the number of trips to query group
membership held in and ADAM.
Below is some code that I have butchered from a sample to keep things
simple. The code is intended to bind to a user object and then to iterate
over the group memberships of that user - in order to find out whether the
user is a member of a group. If I was to call this code repeatedly for the
same user it seems to me that there would be repeated binds to the ADAM
followed by repeated iterations of over the group membership.
What suggestions do people have about reducing the number of trips to the
ADAM?
ADsOpenObject(..., (void **)&pIADsUser);
IADsMembers *pIADsMembers;
pIADsUser->Groups(&pIADsMembers)));
pIADsMembers->get__NewEnum(&pUnk);
hr = pUnk->QueryInterface(IID_IEnumVARIANT,(void**)&pEnum);
while (SUCCEEDED(hr) && hr != S_FALSE)
{
hr = pEnum->Next(1, &Variant, &ulElementsFetched)));
// hr = false if there is no next
if (hr != S_FALSE)
{
IDispatch *pDispatch = NULL;
IADsGroup *pIADsGroup = NULL;
hr = pDispatch->QueryInterface(IID_IADsGroup,(VOID **) &pIADsGroup))) ;
pIADsGroup->get_ADsPath(&groupNameBstr);
}
}
.
- Follow-Ups:
- Re: Reducing ADAM Accesses
- From: Phran
- Re: Reducing ADAM Accesses
- Prev by Date: Re: better way to search for users info in AD
- Next by Date: Re: Transitivity and Automatic Site Link Bridging
- Previous by thread: Re: better way to search for users info in AD
- Next by thread: Re: Reducing ADAM Accesses
- Index(es):
Relevant Pages
|