Solved

LDAP Search filter for Exchange Addresslist

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
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…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

929 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

11 Experts available now in Live!

Get 1:1 Help Now