Link to home
Start Free TrialLog in
Avatar of Joseph Daly
Joseph DalyFlag for United States of America

asked on

Help combining two LDAP queries

So I am trying to find all of the distribution groups that are in my AD environment that allow unauthenticated users to send to them.

In another question I was directed to the following LDAP query
(&(objectClass=group)(!msExchRequireAuthToSendTo=TRUE))
This query will return all distribution groups that dont require authentication.

This seems to work OK except it returns extra results. I am only interested in email enable distribution groups. I was able to come up with a query to find these.
(&(&(& (mailnickname=*) (| (objectCategory=group) ))))

What I would like to know is how can I combine these two queries so that they will only return mail enabled groups that dont require authentication?
ASKER CERTIFIED SOLUTION
Avatar of Mike Kline
Mike Kline
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Joseph Daly

ASKER

Well you know something I didnt use ADfind but your example did point me in the right direction.

I was able to test this using find, custom search in ADUC. Modified your syntax a little bit to below

(objectcategory=group)(!msExchRequireAuthToSendTo=TRUE)(mailnickname=*)

And it in fact does return a list of distribution groups where authentication is not turned on.

Thanks