Announcement

Collapse
No announcement yet.

Simple LDAP query ?!?!

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Simple LDAP query ?!?!

    I hope someone can help!

    I'm trying to create a Custom Address List using the "Custom Search" facility in System Manager, but can't work out the syntax for what (I believe?) should be a straighforward search.

    Basically, I'd like the search to return all objects (users/contacts/groups) within an OU.

    Can anyone please provide a sample LDAP string to try?

    THANKYOU

  • #2
    Paul, see my site for such tips and examples:

    http://www.petri.com/ldap_search_sam...d_exchange.htm
    Cheers,

    Daniel Petri
    Microsoft Most Valuable Professional - Active Directory Directory Services
    MCSA/E, MCTS, MCITP, MCT

    Comment


    • #3
      Thanks Daniel,

      I already looked there, but I couldnt see an example that shows how to filter items within an OU - just all GroupMembers within an OU.

      Can you enlighten me?

      Thanks,

      Paul.

      Comment


      • #4
        I'm not sure you can have a filter based upon the OU membership.
        Cheers,

        Daniel Petri
        Microsoft Most Valuable Professional - Active Directory Directory Services
        MCSA/E, MCTS, MCITP, MCT

        Comment


        • #5
          Sorry Daniel - I'll try and be clearer.

          We have an OU called "Distribution Lists" that contains both Distribution List and external Contacts objects. I'd like to create a custom Address Book that only displays those entities, but am struggling!

          I dont seem able to use any of the "standard" filter attributes, so need to form an LDAP string which equates to "only items with the OU called Distribution Lists"

          Does that make sense?

          Thanks in advance,

          Paul.

          Comment


          • #6
            Do you have sub-OUs in the OU you want to search in ?
            Guy Teverovsky
            "Smith & Wesson - the original point and click interface"

            Comment


            • #7
              No, the OU is at the bottom of a tree of OUs.

              I was wondering whether I could do some kind of wildcard search on the DN's of the items within the OU, but wouldnt know where to start!

              Thanks,

              Paul.

              Comment


              • #8
                Sorry, but my comment is not relevant - you can't use wildcards on DN syntax.
                If using DN as search attribute, you need to specify FULL DN and you have to use the "=" operator (no ":=1212yabadabadooo" are allowed)

                what you can do is write a VBS script that stamps the objects in a given OU (make it scheduled job) and have Exchange filter based on some extensionAttribute9 (or whatever you like) you have stamped with some value (name of the dist-list sounds like a good candidate)
                Guy Teverovsky
                "Smith & Wesson - the original point and click interface"

                Comment


                • #9
                  Thanks Guy.

                  I did try stuffing "Distbution List" as the "Title" attribute on the Contacts, so I could build the Address Book with a guery that said "all groups beginning with "IMG (our standard), plus any Contacts with title set to Distribution List". Unfortunately, it doesnt seem to work either?

                  Have you come across the problem of not being able to search on the "Title" string of a contact?

                  I'm not having a good day

                  Comment


                  • #10
                    Can you supply the actual LDAP query ?

                    p.s.: I would try to avoid spaces in the value string and would use some attribute that is not in use and not "customer facing".

                    p.p.s.: it's all about the amount of coffee

                    you can also test your LDAP filter via ADUC or dsquery to see if it returns any results.
                    Guy Teverovsky
                    "Smith & Wesson - the original point and click interface"

                    Comment


                    • #11
                      If I create a filter based on

                      (&(objectCategory=contact)(personalTitle=D*) )

                      it returns no objects - despite me having 30+ contacts with "Distribution List" in the (Organization) title field. I get the same resulst if I do a normal AD search too.....?

                      As you might have guessed, I'm very much an LDAP novice, so am trying to avoid doing too much with scripts - I just want an easy way to display only specific groups in an Address Book

                      I think I passed the coffee stage hours ago

                      Comment


                      • #12
                        try:

                        (&(objectCategory=contact)(title=D*))

                        tip: you can always use adsiedit.msc from support tools to investigate AD and LDAP attributes.
                        Guy Teverovsky
                        "Smith & Wesson - the original point and click interface"

                        Comment

                        Working...
                        X