Re: Reducing ADAM Accesses
- From: Phran <Phran@xxxxxxxxxxxxxxx>
- Date: Thu, 15 Feb 2007 08:32:00 -0800
Hi Joe, thanks for this suggestion. I have looked at some documentation on
MSDN but I can't find anything obvious that seems to cover reducing traffic.
Was there anything in particular that you had in mind?
"Joe Kaplan" wrote:
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: Joe Kaplan
- Re: Reducing ADAM Accesses
- References:
- Re: Reducing ADAM Accesses
- From: Joe Kaplan
- Re: Reducing ADAM Accesses
- Prev by Date: Re: Reducing ADAM Accesses
- Next by Date: Create Sandbox for MS server 2003
- Previous by thread: Re: Reducing ADAM Accesses
- Next by thread: Re: Reducing ADAM Accesses
- Index(es):
Relevant Pages
|
Loading