Solved

LDAP Search filter for Exchange Addresslist

Posted on 2009-04-09
5
738 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
  • 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

830 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