The other day while I was working in a project, a client who has synced the OnPrem AD to Online, asked me if it was possible to hide some people search results, because it was showing irrelevant information from some people.
It is not the typical filter that you can set in the AADConnect to filter by OU, it was needed to filter based on a profile property.
So, what we can do? In this case to create a custom property in SPO admin Center and use Search with a DT to hide the search results that we want.
Let’s say in this case, that I need to create a property called “ExcludePeopleSearch” as a Boolean and the privacy set to “everyone”
Once this has been created, we need to add some values to some profiles, in order to contain information and the search be able to index the results, generally it takes about 24 hours to index all the information.
Once it have been indexed, you can can map that to a search managed property, and add that to the search based Directory to get them excluded.