1

We are currently trying to filter the People Picker in SharePoint 2019 for users and groups, but we have a little bit of trouble.

Currently, we have the following filter:

(&(objectCategory=person)(objectClass=user)(|(sn=svc*)(!givenName=*)))

// or more clearly

(&
    (objectCategory=person)
    (objectClass=user)
    (|
        (sn=svc*)
        (!givenName=*)
    )
)

This filter is a little bit strange, but it works as expected. More precisely, because we have ADFS and NTLM authentication set up for our WebApplication, we have every account twice. This filter sets the People Picker to display UPN and service accounts only.

However, now, we would also like to filter every group starting with "LD". So, we tried, among many other things, the following filter:

(|(&(objectCategory=person)(objectClass=user)(|(sn=svc*)(!givenName=*)))(&(objectCategory=group)(!cn=LD*)))

// or more clearly

(|
    (&
        (objectCategory=person)
        (objectClass=user)
        (|
            (sn=svc*)
            (!givenName=*)
        )
    )
    (&
        (objectCategory=group)
        (!cn=LD*)
    )
)

Unfortunately, it doesn't work. We tried to play with displayName, name and mail without success. The first part of the filter works fine, but the second part is ignored. We also tried to use objectCategory=CN=Group,CN=Schema,CN=Configuration,DC=Domain,DC=com instead of objectCategory=group and objectClass=group, without more chance.

We use the following commands to apply filtering:

$webApp = Get-SPWebApplication https://some.sharepoint.farm.com
$webApp.PeoplePickerSettings.ActiveDirectoryCustomFilter = "SUPER AWESOME FILTER"
$webApp.Update()
iisreset

// and a good clear cache for our browser

The solution is probably right under our noses, but we can not figure this problem out.

Can anyone kindly give us a hand on this?

Many thanks in advance!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.