[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1708
  • Last Modified:

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?
0
Joseph Daly
Asked:
Joseph Daly
1 Solution
 
Mike KlineCommented:
I don't have exchange in the lab at home (will install it soon) so I haven't fully tested
 I like adfind http://www.joeware.net/freetools/tools/adfind/index.htm
 
Try
adfind -default  -f "&(objectcategory=group)(legacyexchangedn=*)(!msExchRequireAuthToSendTo=TRUE)" name
Let me know if that works
Thanks
Mike
0
 
Joseph DalyAuthor Commented:
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
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now