Home
Microsoft

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). Hint: You may need to add/update the “MailNickName” attribute in on-prem AD for the msExchHideFromAddressLists  to sync.
  3. msExchHideFromAddressLists AD property contents are mapped to the UPA SPS-HideFromAddressLists

Note: Changing msExchHideFromAddressLists does not remove the user from the Organization view in Delve.

 

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.

 

Remove the user from the Organization view in Delve:

  1. Find the user that you no longer want to show up in the Organization view in on-premises AD.
  2. Remove the manager value for the user. You will also need to update or change another synced field at the same time for the null value to be successfully synced. Examples of fields used include:  'MailNickName', 'Birthday', etc.   
  3. Run a Sync.

 

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.
  3. Changing msExchHideFromAddressLists does not remove the user from the Organization view in Delve.

 

8 Comments

Is there a powershell script to find all places in sharepoint online the search results web part has been added? That's probably a tougher nut to crack, @Tania Menice

New Contributor

Hi,
because of the hint: "This process does not work for cloud accounts.", I have the question if there is a solution for cloud accounts?

Obviously there is for those users, who should no longer be displayed in Delve or in search-results, only the deletion or did someone else has another good idea?

Warm regards


@Tania Menice wrote:

...

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.
  3. Changing msExchHideFromAddressLists does not remove the user from the Organization view in Delve.


Andreas

Senior Member

Hello,

is this article still actual? We are trying to implement that but it does not look to work.

Visitor

Hello,

 

I tried to do this on Delve and HideFromAddress, but It didn't work.

I need to hide some accounts on Delve, but I can't exclude this accounts from Office365, because I need to preserve the mailbox.

 

Senior Member

@Milena Mocci, we are in discussion with MSFT and we have an incident open with them, to make this procedure working.

Main issue is that this could take weeks or months.

The more customers will raise this issue and probably resolution speed will increase :)

Microsoft

@Curzio Scuffi Yes it still works for hiding users from SharePoint People Search (classic experience), I helped a customer through the process a few weeks ago.  It is still limited to only synced users (not cloud only accounts). I checked with the Delve team and there are some updates that are occurring within Delve that could result in the users being returned in search. I am planning on updating the blog to reflect that. 

Successfully hidden users from Classic SharePoint People Search Results 

But still showing in Delve

New Contributor

Can Someone help me to Disable some SharePoint User Profiles to sync from Azure AD
Those users licenses are removed and accounts are disabled(Not completely deleted).
We want store their mailbox and One Drive.