Excluding FBA users from people search

When you’re using FBA authentication to allow external users access to your SharePoint environment, you’ll notice that when using people search, those account will also show up. In some cases this might be usefull, but sometimes you’ll want to exclude those users and only show your internal domain users.

Settings this is is quite easy using these steps:

  1. Perform a search which returns both domain as FBA users (or perform two seperate searches).
  2. Copy the link from the search results for both kind of users.
  3. When you compare the links, you’ll see something like this:
    http://www.sharepoint.com/mysites/Person.aspx?accountname=DOMAIN\user
    http://www.sharepoint.com/mysites/Person.aspx?accountname=i%3A0%23.f|fbaprovider|user
    Notice that the ?accountname starts with a different prefix for the two account types
  4. Go into your Central Administration pages, click Service Applications and open up search.
  5. Choose crawl rules in the left menu and create a new rule
  6. If you want to exclude FBA account like me, create a new exclusion rule and enter a URL like
    http://www.sharepoint.com/mysites/Person.aspx?accountname=i%3A0%23.f|fbaprovider|*

Make sure you perform a full crawl so this new rule get’s applied to your index. The search engine will now ignore your FBA users and won’t display them any more in the search results. If you  want to perform the same thing but for domain users, you can just swap the URL’s. This will also work when you’re using the sps:// service to index your users, since it’s based purely on the URL’s of the searchable items, not the source they’re coming from.

Leave a Reply

Your email address will not be published. Required fields are marked *