Free search problem... RRS feed

  • Question

  • User-2079623988 posted

    I have played with different String.Format but not find any solution to my problem.

    I want to have only one textbox, to do a free search in AD.
    Now I am using two, three textbox to search in diffrent attribut.

    Lets say a user searching for "erik".
    i want to search in "givenname" for erik, but I want also to search in "sn" for erik

    So the result will look like this.

    Erik Allonso
    Erik Lindgren
    Charlie Eriksen
    Joey Erikson

    and so on....


    And if a user has "erik" in både "givename" and "sn", like; Erik Eriksen, the result will only be one, not two.

    Feel like its not in the string.format that the solution lies.

    Anyone have any ide´?




    Tuesday, June 27, 2006 5:18 AM

All replies

  • User1354132231 posted
    Have you tried using an Ambiguous Name Resolution (ANR) search?

    This type of search looks over quite a few attributes (configurable).  For instance:


    expands to:

    Be careful.  It can be a big performance hit to use this because of how big it expands...
    Tuesday, June 27, 2006 8:44 AM
  • User-2079623988 posted

    Nice!! ,it works fine.... thanks again.

    One more question, how do I add more attributes to ANR, i want to add "department" to. Then the search engine will be perfect, can I do it with c# code or is it a change in AD?



    Wednesday, June 28, 2006 2:17 AM
  • User-2079623988 posted
    We use Win 2003 server....btw...
    Wednesday, June 28, 2006 4:39 AM
  • User1080000547 posted


    Adding attributes to an ANR search require a modification to the AD Schema. I have done this to add employeeId to the search. The following site will show you how to do it:




    Sunday, July 2, 2006 9:13 AM