Exclude Users From Delve and SharePoint Online People Search


In support, we receive requests from time to time for information on how-to configure SharePoint People search and Delve results so that specific users do not appear in search results. Many admins want to be able to do this without having to delete or move users to a non-synced OU.

The best way to accomplish this is to make the following changes:

In your On-premises AD:

  1. Set the profiles AD property msExchHideFromAddressLists  to True or Yes
  2. Run a Sync (DirSync etc) which will in turn be synced to SPO(If the change is made in Exchange Online, it will not be synced to SharePoint Online)
  3. msExchHideFromAddressLists AD property contents are mapped to the UPA SPS-HideFromAddressLists

Once sync completes to UPA, there will be a profile incremental crawl that needs to complete so that the index has the managed property SPS-HideFromAddressLists.

 

Delve automatically excludes or filter all profiles that have SPS-HideFromAddressLists managed property set to true so no additional changes/configurations need to be done for Delve. However, the SharePoint people search does not exclude these profiles automatically. The following configuration steps need to be performed to exclude these profiles from appearing in the SharePoint Online People search results:

  1. Go to enterprise search people results page: https://contoso.sharepoint.com/search/Pages/peopleresults.aspx
  2. Edit Search Results page
  3. Edit People Results Web Part
  4. Change query
  5. Change Query Text from {searchboxquery} to {searchboxquery} -"SPS-HideFromAddressLists":1

NOTE: because of the dash in the managed property name, the managed property SPS-HideFromAddressLists needs to be enclosed in "" (make sure that you are using the correct "" and - otherwise your search results will be incorrect)

  1. Apply changes to the Search results Web Part
  2. Check-in changes to the Page
  3. Publish changes

NOTE: If you have any customization that use the Local People Results, similar changes needs to be implemented to automatically exclude all profiles configured -"SPS-HideFromAddressLists":1 to be excluded from there as well.

Known limitations:

  1. This process does not work for cloud accounts.
  2. If you want the user to be returned in search you will need to change the msExchHideFromAddressLists value to false or no. If the value is only set to null in most cases it will not be synced down to SharePoint Profile and will continue to be removed from search.
Comments (0)

Skip to main content