Tuesday, October 15, 2013

SharePoint 2010 People Search Filtering

Working on our internal Phone book in SharePoint using the Enterprise Search: People Search Feature. I had to ensure none of our service accounts or other non-company users were being displayed.

First I setup Connection filters.

  • Central Administration > Application Management > Service Applications > 
  • Manage Service Applications > User Profile Service > Synchronization > 
  • Configure Synchronization Connections > [Your AD Connection] > Edit Connection Filters

Used the Any apply (OR) for the following rules:

         Attribute                         Operator                               Filter
sAMAccountName                 Contains                            Calendar 
sAMAccountName                 Contains                            Privileged 
sAMAccountName                 Contains                                   _ 
userAccountControl                Bit on equals                            17

This takes care of the accounts we have for department calendars [deptcalendar], any elevated management accounts [username Privileged], service accounts [System_Service] and any account that has a non-expiring password.

No even with all of this I was still seeing a service account sneaking in creating its own profile and for the life of me I could not stop it.  I don't care if it has a mySite I just don't want it to show up in our Phone book. 

After about a day and a half of searching finally came across the process to resolve this issue.  I needed to set up an exclusion on the People Search Core Results > Results Query Options > Append Test To Query.
-prefrerredname:"[enter format here]" in our case I setup -preferredname:"SP_*".  Ensure you do this to any pages that contain the People Search Core Results web app in our case we have two pages: People-Directory and peopleresults.

No comments:

Post a Comment