Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

LDAP Search filter for Exchange Addresslist

Posted on 2009-04-09
5
Medium Priority
?
761 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 1500 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 1500 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
Active Directory can easily get cluttered with unused service, user and computer accounts. In this article, I will show you the way I like to implement ADCleanup..
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 transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
Suggested Courses

618 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