locked
Use peoplepicker-searchadcustomquery to restrict people picker results RRS feed

  • Question

  • Hi all,

    I am trying to restrict the people picker results with the stsadm command stsadm -o setproperty -pn peoplepicker-searchadcustomquery, but I can't get it to work. What I want to achieve ist the following:

    I have multiple trusted domains. I want to be able to search in all the domains (which is already possible), but in one domain no group selection should be possible.

    So I wanted to try the following as a first step: restrict the people picker of a testserver to show only the users of my domain (no groups). I used the following command:

    stsadm -o setproperty -pn peoplepicker-searchadcustomquery -pv "(&(userPrincipalName=*@test.local)(objectClass=user))" -url http://testapp

    The query worked when testing it with ldp.exe, but in SharePoint it has no effect. The groups are still found. I also did iisreset. Is there anything else I have to do? Is my query wrong or is it not possible to restrict the query using this stsadm property?

    Please help!

    Thx in advance, Mel

    Monday, November 8, 2010 2:52 PM

All replies

  • Hi Mel,

    Maybe you can try the following command again (without double quotation marks).

    stsadm -o setproperty -pn peoplepicker-searchadcustomquery -pv (&(userPrincipalName=*@test.local)(objectClass=user)) -url http://testapp


    Best regards. Emir
    • Marked as answer by Lily Wu Thursday, November 18, 2010 8:12 AM
    • Unmarked as answer by grrrr Thursday, November 18, 2010 8:24 AM
    Thursday, November 11, 2010 10:51 AM
  • Hi Emir,

    I tried it without quotation marks, but then I get the following error message:

    (objectClass was unexpected at this time.

    I didn't get this to work with peoplepicker-searchadcustomquery, instead I used peoplepicker-searchadcustomfilter. Although the documentation says that the filter is only applied in the search dialog and not in "Check Names". That's why I didn't try that in the first place. But in my tests it worked for both cases.

    If there is a possibility to get peoplepicker-searchadcustomquery to work, I would be interested nevertheless.

    Does anybody really know what the difference between these two properties is?

    Thx, Mel

    Thursday, November 18, 2010 8:23 AM