Overview
Users who no longer belong to the organization still appear in SharePoint Search by default or in the intranet Employee Directory. Or there might be test or service accounts which need to be in SharePoint for other applications, but they are not tied to people and can be confusing when they pop up in people searches.
This article describes the steps needed to remove / hide/ exclude unwanted results from SharePoint People Search.
Solution
To remove such results, the following procedure needs to be applied in online/cloud environments so only 'active' users are shown.
Please ensure you have Administrator Access/Permissions O365 suite, SharePoint Site Collection, and On-Premise Active Directory.
-
Set the msExchHideFromAddressLists property of the user that needs to be hidden from people search or Delve to True or 1. (The technical explanation of the property is mentioned at the bottom).
-
Azure Active Directory Sync should synchronize the changes to Office365 directory services.
-
The change would eventually propagate all the way up to SharePoint Online (SPO)User Profiles.
-
Once changes are synched to User profiles, incremental crawl should crawl the profiles that were set with SPSHideFromAddressLists property.
- Follow the steps that will allow default 'people' search to exclude all profiles with SPS-HideFromAddressLists set:
- Browse to enterprise search people results from the page, example:
https://yoursitename.sharepoint.com/sites/bonzai/search/Pages/peopleresults.aspx - Edit Search Results page.
- Edit People Results in Web part.
- Change query.
- Change Query Text from {searchboxquery} to {searchboxquery} –“SPS-HideFromAddressLists”:1
- Apply changes.
- Check-in changes and publish the page.
- Browse to enterprise search people results from the page, example:
You can also check these articles
- Exclude Users from Delve and SharePoint Online People Search
- Exchange: Hide Disabled Users from the Global Address List (GAL) | miriamxyra
- Office 365: Hide a user from the GAL when using Azure AD Connect (tachytelic.net)
- Exclude-users-from-sharepoint-search-results-using-crawl-rules (requires using regular expressions)
Testing
To verify crawl has updated the index with the above changes, perform the steps below:
- Browse to search centre in SharePoint Online and click on People search vertical.
- Type below query and you should see the result of the person that you intend to hide, for example:
https://yoursitename.sharepoint.com/sites/bonzai/search/Pages/peopleresults.aspx?k=krunal%20mehta - To hide profiles with SPSHideFromAddressLists property updated in the search index, for example:
https://yoursitename.sharepoint.com/sites/bonzai/search/Pages/peopleresults.aspx?k=krunal%20mehta%20-sps-hidefromaddresslists:1
Priyanka Bhotika
Comments