Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Active Directory > Re: Multiple Group Query

Reply
Thread Tools Display Modes

Re: Multiple Group Query

 
 
Chris Dent
Guest
Posts: n/a

 
      05-27-2010

Yes, you would need to know the distinguished names for both groups,
then you would construct a filter like this:

(&(!(memberOf=CN=Group
1,OU=somewhere,DC=domain,DC=com))(!(memberOf=CN=Gr oup
2,OU=somewhere,DC=domain,DC=com)))

You don't have to use the LDAP filter, you might choose to use an OPath
Filter with Get-User:

Get-User -Filter { -Not (memberOfGroup -eq "CN=Group
1,OU=somewhere,DC=domain,DC=com") -And -Not (memberOfGroup -eq "CN=Group
2,OU=somewhere,DC=domain,DC=com") }

HTH

Chris

yankz23 wrote:
> Hello,
>
> I am using Exchange 2007. I am looking to perform a search in Active
> Directory for users who are not in specific groups. Is there a way to
> perform this search with multiple groups in 1 search to see who is not
> in these groups? Ive been searching the net but haven't really found an
> answer.
>
> Thanks in advance
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
No network drive mapping after joining Active Directory ? Patrick Active Directory 29 05-05-2010 12:21 PM
Re: Group membership query fails because of special character Richard Mueller [MVP] Scripting 0 03-17-2010 02:29 AM
Overriding default SBS 2008 policies Andrew M. Saucci, Jr. Windows Small Business Server 4 02-08-2010 07:36 AM
Re: DC with "Windows cannot obtain the domain controller name for your computer network" Danny Sanders Active Directory 0 01-21-2010 02:26 PM
2nd Domain in a 2 domain forest cannot be contacted David Alge DNS Server 30 01-21-2010 05:26 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59