Hiding People from People Search

Posted By:

Date: May 23, 2016 at 4:04 pm

 

HidingPeoplepic

 

This all started as a request from a client to hide only certain users from the people search. I’ve decided on this route because the management interface already exists to update user profiles and it would be very little work to add a user profile property, get it crawled and use that as the filter in the people search results webpart. Below I will explain how I was able to accomplish this in Office 365 but the same would work for a SharePoint 2013 on prem.

 

In Office 365 -> SharePoint Administration -> User Profiles

SavePeople

 

Click “Manage User Properties” under the People Group

SavePeople1

 

Click “New Property”

SavePeople2

 

Set the following properties (everything else leave be)
Name: HideFromPeopleSearch
Display Name: HideFromPeopleSearch
Policy Setting: Optional
Default Privacy Settings: Everyone
Search Settings -> Alias [checked]
-> Indexed [checked]

SavePeople3

SavePeople4

SavePeople5

SavePeople6

Click “OK”

 

 

Wait some amount of time for O365 to index the User Profiles and retrieve this new field.

You’ll know it’s ready when you can find the new Property in the Search Schema, Crawled Properties.

 

From the Admin Center click “search” in the left hand menu

SavePeople7

 

Click “Manage Search Schema”

SavePeople8

 

Click “Crawled Properties”

SavePeople9

 

Enter “Hide” in the Crawled properties search box, then click the green arrow

SavePeople10

 

You will see the property appear in the search results when the property has been successfully crawled.

SavePeople11

 

Next you will need to create a “Managed Property”, Click On the “Managed Properties” link

SavePeople12

 

Click “New Managed Property”

SavePeople13

 

Enter the following information:
Property Name: HideFromPeopleSearch
Type: Text
Queryable: Checked
Retrieveable: Checked
Add Property Mapping -> People:HideFromPeopleSearch

SavePeople14

SavePeople15

SavePeople16

SavePeople17

Click Add A Mapping

 

 

Enter “Hide” in the search box, click the Find button

SavePeople18

 

Select “People:HideFromPeopleSearch”, click the OK button

SavePeople19

 

Leave all the other properties as-is, click OK

SavePeople20

 

You will now have to wait until Office 365 runs a full crawl on your site for the property to become available in search. When this action takes place is unknown. (I’ve head 4 hours)

 

Next go to the people search page

Edit the page and Edit the Web Part Properties of the People Search Core Results

SavePeople21

 

Click Change Query

SavePeople22

 

In the Property Filter drop down select –Show all managed properties–

SavePeople23

 

Select HideFromPeopleSearch

SavePeople24

 

Select “Not equals” then “Manual Value”
Enter “True” for the Manual Value
Next Click Add property filter

SavePeople25

 

Click OK

SavePeople26

 

Click OK in the People Search Core Results, Web Part Properties pane

SavePeople27

 

Save, Check-In & Publish your page – All Set!

 

This procedure is on a page by page basis. If you have more than 1 people search web part you will need to modify those pages to enable them to hide people.

 

 

 

2 comments

 

2 responses to “Hiding People from People Search”

  1. Geoff Talbot says:

    Hi Tom,

    Very helpful article… I think the idea of hiding certain people is very useful, in terms of security and internal workflow etc.

    Have you seen any 3rd party tools that do this, without the above?

    Thanks again
    Geoff

    • admin says:

      Geoff,

      I am glad you like the article. Unfortunately I have not seen any 3rd party tools that can do this.

      Thank you