Solved

LDAP Search filter for Exchange Addresslist

Posted on 2009-04-09
5
744 Views
Last Modified: 2013-12-24
I am trying to combine two filters together but can't seem too get it working

Filter 1:
(objectCategory=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)(!userPrincipalName=ZZ*)(!userPrincipalName=#*)(!userPrincipalName=zz*)(|(mail=*domainX.nl)(mail=*domainY.nl))))

Filter 2:
(&(mailnickname=*)(objectCategory=group)(|(proxyAddresses=*domainX.nl)(proxyAddresses=*domainY.nl)))

Combined filter:
(&(&(objectCategory=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)(!userPrincipalName=ZZ*)(!userPrincipalName=#*)(!userPrincipalName=zz*)(|(mail=*domainX.nl)(mail=*domainY.nl)))(&(objectCategory=group)(|(proxyAddresses=*domainY.nl)(proxyAddresses=*domainX.nl))))

I am clueless at the moment as too what i going wrong when combining the two so any help is more then welcome
0
Comment
Question by:Frederikyim
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 23

Accepted Solution

by:
Stacy Spear earned 500 total points
ID: 24117512
How many domains do you have? If only those two, then checking for email address can be changed to mail=* and proxyaddresses=*, that alone with speed up it up greatly.

Assuming that either of those are valid as is for inclusion in the list, you need to use an or filter not the and that you have currently.
(|(objectCategory=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)(!userPrincipalName=ZZ*)(!userPrincipalName=#*)(!userPrincipalName=zz*)(|(mail=*domainX.nl)(mail=*domainY.nl))(&(mailnickname=*)(objectCategory=group)(|(proxyAddresses=*domainX.nl)(proxyAddresses=*domainY.nl))))

Open in new window

0
 

Author Comment

by:Frederikyim
ID: 24130405
I'll check tommorow but no these two are not our only domains , the goal is too make an adress list of just those 2 e-mail domains users & groups.
0
 

Author Comment

by:Frederikyim
ID: 24146193
Nope no luck I am afraid, now I am getting DNS records hidden users groups everything.
I only need the users and distri groups show in the list..
0
 
LVL 23

Assisted Solution

by:Stacy Spear
Stacy Spear earned 500 total points
ID: 24147145
hmmm, try this one.
(|((objectCategory=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)(!userPrincipalName=ZZ*)(!userPrincipalName=#*)(!userPrincipalName=zz*)(|(mail=*domainX.nl)(mail=*domainY.nl)))(&(mailnickname=*)(objectCategory=group)(|(proxyAddresses=*domainX.nl)(proxyAddresses=*domainY.nl))))

Open in new window

0
 

Author Comment

by:Frederikyim
ID: 24213316
Still it gives me the same result.. it gives every  objct in the AD now :(
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains the steps required to use the default Photos screensaver to display branding/corporate images
This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question