View Full Version : GAL LDAP Query


camnet.systems@gmail.com
10-16-2006, 03:38 AM
Hi,

just wondering if someone can help me out. This is an LDAP query with
regards to Microsoft Exchange 2003. I wish to filter out of the GAL
any users with a company1.com or company2.com smtp address. I can get
it to work for one addess but cannot work out how to also add the
seconds address.

eg.

(&(mailnickname=*)(|(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList))(!(ProxyAddresses=*@company1.com))))

This works fine to filter out users with a company1.com smtp address
from the GAL. How do I also add to filter out company2.com smtp
addresses in the same query?

thanks

Dave

Richard Mueller
10-16-2006, 05:42 PM
The clause you want is probably:

(&(!proxyAddresses=*@company1.com)(!proxyAddresses=*@company2.com))

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net

<camnet.systems@gmail.com> wrote in message
news:1160966293.217523.117890@e3g2000cwe.googlegroups.com...
> Hi,
>
> just wondering if someone can help me out. This is an LDAP query with
> regards to Microsoft Exchange 2003. I wish to filter out of the GAL
> any users with a company1.com or company2.com smtp address. I can get
> it to work for one addess but cannot work out how to also add the
> seconds address.
>
> eg.
>
> (&(mailnickname=*)(|(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList))(!(ProxyAddresses=*@company1.com))))
>
> This works fine to filter out users with a company1.com smtp address
> from the GAL. How do I also add to filter out company2.com smtp
> addresses in the same query?
>
> thanks
>
> Dave
>