Solved

LDAP Search filter for Exchange Addresslist

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
Synchronize a new Active Directory domain with an existing Office 365 tenant
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now