Home
%3CLINGO-SUB%20id%3D%22lingo-sub-355526%22%20slang%3D%22en-US%22%3EImproved%20Filtering%20of%20People%20Search%20Results%20in%20Classic%20and%20Custom%20Experiences%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-355526%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20the%20post%20%3CA%20href%3D%22https%3A%2F%2Femea01.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fblogs.technet.microsoft.com%252Fsposupport%252F2017%252F07%252F25%252Fexclude-users-from-delve-and-sharepoint-online-people-search%252F%26amp%3Bdata%3D02%257C01%257CPedro.dosSantos%2540microsoft.com%257C68ebf1f012544cd1e38508d6989585be%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C636864165327777930%26amp%3Bsdata%3DOr5pCdTOd4v0zuUMs%252BzMXjnvJ38LREZirWFnORIf%252FAg%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EExclude%20Users%20From%20Delve%20and%20SharePoint%20Online%3C%2FA%3E%20we%20address%20one%20way%20to%20remove%20user%20profiles%20from%20being%20returned%20when%20searching%20in%20SharePoint%20or%20Delve.%20--This%20is%20done%20by%20setting%20the%20AD%20property%20msExchHideFromAddressLists%20to%20true%2C%20and%20is%20mapped%20to%20the%20managed%20property%20%3CSTRONG%3ESPS-HideFromAddressLists%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20method%20of%20hiding%20user%20profiles%20is%20useful%2C%20but%20there%20are%20easier%20ways%20to%20hide%20types%20of%20profiles%20rather%20than%20having%20to%20set%20msExchHideFromAddressLists%20individually.%20In%20this%20post%20we%20will%20look%20at%20other%20properties%20that%20can%20be%20used%20to%20hide%20profiles%20from%20search%20results.%3CBR%20%2F%3E%3CBR%20%2F%3ENote%3A%20The%20properties%20and%20exclusions%20discussed%20below%20are%20already%20taken%20into%20account%20in%20Delve%20and%20the%20modern%20search%20experience.%20If%20you%20use%20the%20classic%20search%20center%20or%20have%20built%20a%20custom%20search%20experience%20you%20should%20consider%20making%20use%20of%20these%20properties%20in%20additon%20to%20%3CSTRONG%3ESPS-HideFromAddressLists.%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20managed%20property%20%3CSTRONG%3ESPS-UserType%3C%2FSTRONG%3E%20defines%20whether%20a%20profile%20is%20for%20an%20internal%20user%20or%20a%20guest%20user.%20If%20you%20want%20to%20exclude%20guest%20profiles%20from%20search%20results%2C%20you%20can%20add%20to%20a%20query%20%3CSTRONG%3ESPS-UserType%3A0%3C%2FSTRONG%3E.%20Conversely%2C%20to%20only%20return%20guest%20profiles%2C%20use%20%3CSTRONG%3ESPS-UserType%3A1%3C%2FSTRONG%3E.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20other%20useful%20property%20is%20%3CSTRONG%3ESPS-ReceipientTypeDetails%3C%2FSTRONG%3E%20which%20is%20mapped%20to%20MsExchangeRecipientTypeDetails.%20In%20our%20modern%20experiences%20we%20filter%20out%20the%20following%20values%3A%204%20(SharedMailbox)%2C%2016%20(RoomMailbox)%2C%2032%20(EquipmentMailbox)%2C%208589934592%20(RemoteRoomMailbox)%2C%2017179869184%20(RemoteEquipmentMailbox)%2C%2034359738368%20(RemoteSharedMailbox)%2C%20and%202199023255552%20(LinkedRoomMailbox)%3CBR%20%2F%3E%3CBR%20%2F%3ETo%20use%20all%20of%20these%20properties%2C%20you%20need%20to%20create%20a%20new%20result%20source%20to%20replace%20Local%20People%20Results%20with%20the%20query%20transform%20set%20as%20such%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%7B%3F%7BsearchTerms%7D%20(-%22sps-usertype%22%3A1%20AND%20-%22sps-hidefromaddresslists%22%3A1%20AND%20-%22sps-recipienttypedetails%22%3D4%20AND%20-%22sps-recipienttypedetails%22%3D16%20AND%20-%22sps-recipienttypedetails%22%3D32%20AND%20-%22sps-recipienttypedetails%22%3D8589934592%20AND%20-%22sps-recipienttypedetails%22%3D17179869184%20AND%20-%22sps-recipienttypedetails%22%3D34359738368%20AND%20-%22sps-recipienttypedetails%22%3D2199023255552)%20ContentClass%3Durn%3Acontent-class%3ASPSPeople%7D%3CBR%20%2F%3E%3CBR%20%2F%3EThis%20is%20an%20easy%20way%20to%20help%20improve%20the%20people%20search%20experience%20for%20your%20users.%3C%2FP%3E%3C%2FLINGO-BODY%3E

In the post Exclude Users From Delve and SharePoint Online we address one way to remove user profiles from being returned when searching in SharePoint or Delve. --This is done by setting the AD property msExchHideFromAddressLists to true, and is mapped to the managed property SPS-HideFromAddressLists.

 

This method of hiding user profiles is useful, but there are easier ways to hide types of profiles rather than having to set msExchHideFromAddressLists individually. In this post we will look at other properties that can be used to hide profiles from search results.

Note: The properties and exclusions discussed below are already taken into account in Delve and the modern search experience. If you use the classic search center or have built a custom search experience you should consider making use of these properties in additon to SPS-HideFromAddressLists.

The managed property SPS-UserType defines whether a profile is for an internal user or a guest user. If you want to exclude guest profiles from search results, you can add to a query SPS-UserType:0. Conversely, to only return guest profiles, use SPS-UserType:1.

The other useful property is SPS-ReceipientTypeDetails which is mapped to MsExchangeRecipientTypeDetails. In our modern experiences we filter out the following values: 4 (SharedMailbox), 16 (RoomMailbox), 32 (EquipmentMailbox), 8589934592 (RemoteRoomMailbox), 17179869184 (RemoteEquipmentMailbox), 34359738368 (RemoteSharedMailbox), and 2199023255552 (LinkedRoomMailbox)

To use all of these properties, you need to create a new result source to replace Local People Results with the query transform set as such:

{?{searchTerms} (-"sps-usertype":1 AND -"sps-hidefromaddresslists":1 AND -"sps-recipienttypedetails"=4 AND -"sps-recipienttypedetails"=16 AND -"sps-recipienttypedetails"=32 AND -"sps-recipienttypedetails"=8589934592 AND -"sps-recipienttypedetails"=17179869184 AND -"sps-recipienttypedetails"=34359738368 AND -"sps-recipienttypedetails"=2199023255552) ContentClass=urn:content-class:SPSPeople}

This is an easy way to help improve the people search experience for your users.