Excluding users from People Picker
-
08-02-2021 - |
문제
SharePoint 2010
I recently used the following command to target a specific Active Directory Organizational Unit set of users.
stsadm -o setsiteuseraccountdirectorypath -path "OU=My Employees,OU=User Accounts,OU=New Structure,DC=corp,DC=mydomain,DC=net" -url https://mysite
This worked well, but soon realized that Contractors are placed in a slightly different OU. Their path looks like: OU=My Contractors,OU=User Accounts,OU=New Structure,DC=corp,DC=mydomain,DC=net
I discovered that users in this path could not login to SharePoint.
So my question is, how can I exclude certain paths or include more than one? My main goal is to avoid including Service Accounts which are located in an OU all their own. Like this: OU=Service Accounts,OU=User Accounts,OU=New Structure,DC=corp,DC=mydomain,DC=net
Thank you.
해결책
UserAccountDirectoryPath
only supports a single value. You can use peoplepicker-searchadcustomfilter
to create an LDAP filter, though you need to have object attributes to filter from (the DN
won't be one of the applicable attributes).