Help with small LDAP query

C

Clayton Sutton

We are running a Win2k3 domain and Exchange 2003 using Outlook 2003. We
have a custom "Global Address List" that shows all email enabled accts.
(mail=*mail.mydomain.edu). What I would like to do is also display all
contacts as well. I tried the query below and tried to preview it but it
didn't work. Can anyone give me some pointers on how to get it working?

(&(&(mail=*mail.mydomain.edu) (|
(&(objectCategory=person)(objectClass=contact)))


TIA,

Clayton
 
J

Joe Richards [MVP]

Yeah that query isn't valid. You should test your queries with ldap clients to
see what they return...

Here is what you have...

(&
(&
(mail=*mail.mydomain.edu)
(|
(&
(objectCategory=person)
(objectClass=contact)
)
)

Notice how two paren's aren't closed?

So let's say you closed them, your query is really

(&
(mail=*mail.mydomain.edu)
(objectCategory=person)
(objectClass=contact)
)

That would return all contacts with mail address ending in mail.mydomain.edu. No
users... just contacts.


If you have mail=*mail.mydomain.edu that should get users, contacts, everything.
The same considerations for efficient queries doesn't apply to AL's. AL's don't
really do LDAP queries against AD, they match inside the RUS as it looks at
updated objects.


joe
 
A

Ace Fekay [MVP]

In
Clayton Sutton said:
We are running a Win2k3 domain and Exchange 2003 using Outlook 2003. We
have a custom "Global Address List" that shows all email enabled
accts. (mail=*mail.mydomain.edu). What I would like to do is also
display all contacts as well. I tried the query below and tried to
preview it but it didn't work. Can anyone give me some pointers on
how to get it working?
(&(&(mail=*mail.mydomain.edu) (|
(&(objectCategory=person)(objectClass=contact)))


TIA,

Clayton

I'm not in front of an Exchange box to test an AL lookup, but I would try:
objectCategory=user

If that doesn;'t work, I would then try to make up a lookup for what you
want in a user-created AL, then look at the ldap query it creates and use
that. Otherwise, if it doesn't work, I would assume there may be some
filtering (deny on anything?) that is causing it.

--
Ace

This posting is provided "AS-IS" with no warranties or guarantees and
confers no rights.

If this post is viewed at a non-Microsoft community website, and you were to
respond to it through that community's website, I may not see your reply
unless that website posts replies back to the original Microsoft forum.
Therefore, please direct all replies ONLY to the Microsoft public newsgroup
this thread originated in so all can benefit or ensure the web community
posts it back to the original forum.

Ace Fekay, MCSE 2003 & 2000, MCSA 2003 & 2000, MCSE+I, MCT, MVP
Microsoft MVP - Windows Server Directory Services
Microsoft Certified Trainer
Infinite Diversities in Infinite Combinations.
=================================
 
J

Joe Richards [MVP]

objectcategory=user will be turned into objectcategory=person. user is only an
objectclass.
 
A

Ace Fekay [MVP]

In
Joe Richards said:
objectcategory=user will be turned into objectcategory=person. user
is only an objectclass.

Of course! I thought it can be used. I'm not the best at LDAP search
strings. I usually like to play with the LDAP search strings the wizard
creates and take if from there.

Thanks Joe!

Ace
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top