How to exclude specific AD OU from SharePoint 2013 people picker?
Is there a way to exclude specific AD OU from SharePoint 2013 people picker?. The reason for this is to exclude Shared Mailbox accounts not to resolve in SharePoint people picker, so that can not add these to SP sites.

Sharath Kumar AluriRank #3,241 · 442 reputationPosted Jul 7, 2020, 9:15 AM EDT
Try with the below sample query. If your OU is Shared Mailbox and you want to avoid the specific one try with the below query.
$wa.PeoplePickerSettings.ActiveDirectoryCustomQuery = "(|(mail=*)(objectcategory=group)(!(distinguishedName:=%Shared Mailbox%))"
MadhuRank #5,790 · 286 reputationPosted Jul 7, 2020, 11:57 PM EDT
Habibur RahamanRank #594 · 4.1K reputationPosted Jul 11, 2020, 5:02 AM EDT
MadhuRank #5,790 · 286 reputationPosted Jul 15, 2020, 9:59 PM EDT