Issue while Setting people picker for SharePoint 2019

Copper Contributor

hello All,

I have working on building SharePoint 2019 environment and have requirement to set peoplepicker to set to get limited users only from Active directory.

 

I am using below script to set .

 

$WebApp = Get-SPWebApplication https://sharepoint.abc.com/;
$WebApp = Get-SPWebApplication http://AppServer/;
$WebApp = Get-SPWebApplication http://AppServerFQDNUrl/;

 

$WebApp.PeoplePickerSettings.ActiveDirectoryCustomFilter = "(&(!samaccountname=x6*)(!employeetype=type1)(!employeetype=type2)(!employeetype=type3)(!employeetype=type3)(!employeetype=type4)(!userAccountControl:1.2.840.113556.1.4.803:=2))"

 

$WebApp.Update()

 

Filter query is not working correctly in people picker.

But same time when I run this for using below method, it gives expected results.

 

Get-ADObject -LDAPfilter '(&(!samaccountname=x6*)(!employeetype=type1)(!employeetype=type2)(!employeetype=type3)(!employeetype=type3)(!employeetype=type4)(!userAccountControl:1.2.840.113556.1.4.803:=2))' | ogv

 

 

1 Reply

@VichareRohan hi, try to start wireshark with monitoring LDAP traffic on your WFE server, then try to find some user through peoplepicker, stop monitoring in Wireshark.

 

Look to the LDAP query, and DomainController that response on your query. In my case was, that my queries went to wrong DC(domain orgname.com instead corp.orgname.com).

 

After I've added peoplepicker property to look to specific domain, filters start to work fine.