Announcement

Collapse
No announcement yet.

AD LDAP Custom Query

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

  • AD LDAP Custom Query

    Hi,

    Im a little new to the LDAP query thing but I usually figure it out but I cant figure this one out.
    We are on Exchange Server 07 and Im trying to do a custom saved query in active directory for the user description and display name fields.
    Now I know you can do searches for that field but i need to do a specific search in those field containing a certain 1 or 2 words. i cant use the default searches of starts with or ends with or present because it will not give me what i want. i need a search that CONTAINS these words.
    I dont care if I have to do 2 separate queries for those 2 fields.

    Many Thanks in advance.

  • #2
    Re: AD LDAP Custom Query

    From the first page of the Saved Query copy the current LDAP string you have so far.
    Change the query to "Custom Search". On the 'advanced' tap paste the string. Customize the string.

    Sample ( description <contains "..."> or displayName <contains "..."> )
    Code:
    (&(objectCategory=person)(objectClass=user)(|(description=*part*)(displayName=*part*)))
    OR... ( description <contains "..."> and displayName <contains "..."> )
    Code:
    (&(objectCategory=person)(objectClass=user)(description=*part*)(displayName=*part*))

    /Rems
    Last edited by Rems; 4th April 2012, 18:03.

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment


    • #3
      Re: AD LDAP Custom Query

      Originally posted by Rems View Post
      From the first page of the Saved Query copy the current LDAP string you have so far.
      Change the query to "Custom Search". On the 'advanced' tap paste the string. Customize the string.

      Sample ( description <contains "..."> or displayName <contains "..."> )
      Code:
      (&(objectCategory=person)(objectClass=user)(|(description=*part*)(displayName=*part*)))
      OR... ( description <contains "..."> and displayName <contains "..."> )
      Code:
      (&(objectCategory=person)(objectClass=user)(description=*part*)(displayName=*part*))
      /Rems
      thank you so much.
      i wound up using bulk export from dovestone to piece together what i need so i did get a list BUT the final number differs from what i get from the query you gave me.
      im off by 22 users with the query you gave me...thats 22 less users.
      so i do like your query but i guess i will have to compare these lists i got from your query with dovestone to see what the difference is.
      id much rather use a custom query in AD as it is just more convenient and faster to get my list.
      the first query you gave me works better than the 2nd one.

      thanks

      Comment


      • #4
        Re: AD LDAP Custom Query

        ok i went through both lists and yours was correct. i had to re-run it thru dovestone again and then i got the same numbers for both.
        of course ill be using your query all the time as it is exactly what i need and much quicker to run.

        i will be posting another question i have and i hope to get lucky with another great response.

        thanks so much for your help.

        Comment

        Working...
        X