Announcement

Collapse
No announcement yet.

LDAP Query

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

  • LDAP Query

    I want to query AD for all enabled users that have "auditor" anywhere in their description. Would this be right?

    Code:
    FilterString = "(&(objectCategory=person)(objectClass=user)" _
      		  & "(description=*auditor*)" _
        		   & "(!(userAccountControl:1.2.840.113556.1.4.803:=2)))"
    OR...do I have to combine like a starting and ending query for the string:

    Code:
    FilterString = "(&(objectCategory=person)(objectClass=user)" _
      		  & "(description=auditor*)" _
      		  & "(description=*auditor)" _
        		   & "(!(userAccountControl:1.2.840.113556.1.4.803:=2))))"

  • #2
    Re: LDAP Query

    If "auditor" can be anywhere in their description (also when it begins or ends with it, or exist somewhere in the middle) then choose the first query.

    The second query only find users where the description begins or the description ends with the string "auditor".


    \Rems

    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: LDAP Query

      Thanks. I wasn't sure if the first one was a valid query, since there is not an option in AD Users and Computers custom queries to just "contain" the search string.

      I guess I could have just tested it out

      Comment

      Working...
      X