Re: LDAP Query Search Help in AD 2003
- From: "Al Mulnick" <amulnick_No_SPAM@xxxxxxxxxxx>
- Date: Tue, 12 Jul 2005 21:59:21 -0400
That would be an OR operation.
Kind of like:
(&(objectCategory=person)(objectClass=user)(|(!memberOf=cn=MyDistGroup,ou=Sales,dc=MyDomain,dc=com)(!memberOf=cn=MyDistGroup2,ou=Sales,dc=MyDomain,dc=com)))
Note: I didn't test it this way, but that's the general idea if not the
absolutely correct syntax. Should be a fairly expensive query though. If you
have a lot of user class objects that are members of multiple groups it
could take a while.
A more efficient way to do that might be to use an alternate storage
mechanism to figure that out. i.e. a DB with a query.
Al
"MrRAlan" <MrRAlan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5F5DA78D-9D98-4DB5-AD15-8AC85D92E5B3@xxxxxxxxxxxxxxxx
> Rich,
>
> I am able to get it to list all members not in one group, but I need to
> check two groups. I am trying to find all exchange recipients who do not
> belong to group A or group B. You see, they need to belong to one or the
> other. I am trying to find mistakes. Thanks.
>
> "Richard Mueller [MVP]" wrote:
>
>> MrRAlan wrote:
>>
>> > I am trying to create a custom search query in an MMC. I want to show
>> > all
>> > Exchange Mailbox Recipients who do not belong to either Distribution
>> > List
>> A
>> > or Distribution List B. I know the exact CN=...etc for each list, it's
>> just
>> > the rest that I cannot figure out. Thanks.
>>
>> Use the memberOf attribute and specify the Distinguished Name of the
>> distribution group. The symbol "!" (the exclamation point) is the "Not"
>> operator. For example:
>>
>> (!memberOf=cn=MyDistGroup,ou=Sales,dc=MyDomain,dc=com)
>>
>> To find all users not in this group:
>>
>> (&(objectCategory=person)(objectClass=user)(!memberOf=cn=MyDistGroup,ou=Sale
>> s,dc=MyDomain,dc=com))
>>
>> Experiment in ADUC in "View", "Filter Options", "Create Custom Filter",
>> "Customize", "LDAP".
>>
>> --
>> Richard
>> Microsoft MVP Scripting and ADSI
>> Hilltop Lab web site - http://www.rlmueller.net
>> --
>>
>>
>>
.
- References:
- LDAP Query Search Help in AD 2003
- From: MrRAlan
- Re: LDAP Query Search Help in AD 2003
- From: Richard Mueller [MVP]
- Re: LDAP Query Search Help in AD 2003
- From: MrRAlan
- LDAP Query Search Help in AD 2003
- Prev by Date: Re: restore permissions on a user's profile folder (roaming profiles)
- Next by Date: Old profile keeps coiming back
- Previous by thread: Re: LDAP Query Search Help in AD 2003
- Next by thread: AD Replication problem
- Index(es):
Relevant Pages
|