Solved

LDAP Query ; Exchange 2007

Posted on 2008-09-30
3
877 Views
Last Modified: 2012-05-05
I am trying to take the following query which is working  in an old vb6 application:

"Select Adspath from 'LDAP://domain/DC=domain,DC=com' where samAccountName='ADGROUP1'"

and get it to take into account multiple AD Group entries like this:

" Select Adspath from 'LDAP://domain/DC=domain,DC=com' where samAccountName='ADGROUP1' or samAccountName='ADGROUP2'"

I've tried multiple syntax changes using what I've seen to be LDAP query methodology; but have been unsuccessful.  Any help would be greatly appreciated.

Thank you
0
Comment
Question by:sny23vpb
  • 2
3 Comments
 
LVL 70

Expert Comment

by:Chris Dent
ID: 22613305

Hey,

You might have more luck with a traditional LDAP filter:

(|(sAMAccountName=ADGroup1)(sAMAccountName=ADGroup2))

Where | represents the Or.

Or is that something you've already tried?

Chris
0
 

Author Comment

by:sny23vpb
ID: 22641727
Would that look like  :

 Select Adspath from 'LDAP://domain/DC=domain,DC=com' where (|(sAMAccountName=ADGroup1)(sAMAccountName=ADGroup2))

I tried that syntax with no luck.
Thank you for your help; I'm not accustomed to writing LDAP queries;
0
 

Accepted Solution

by:
sny23vpb earned 0 total points
ID: 22744315
I ended up just making two passes to the ldap for each condition in the 'or' statement. Thanks for everyones help.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
how to add IIS SMTP to handle application/Scanner relays into office 365.
This video discusses moving either the default database or any database to a new volume.

747 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now