I am working on O365 and have a requirement where I only need to display Users in my people search results. Currently the result also displays few service accounts which I do not want.

Is there a way to remove the user groups, service accounts and non people users from results?

If yes, then please provide the approach.

  • Which user groups do you want to exclude? Jan 9, 2016 at 13:56
  • All the non users and groups. Jan 11, 2016 at 5:01
  • 1
    Please be more specific. In my case I see service accounts but I don't understand what Groups you are referring to or where they are located. I can't help if you are not more specific. Jan 11, 2016 at 12:44
  • Groups meaning - Product Owners , Product Viewers etc. I hope you are clear now. Jan 11, 2016 at 13:06
  • 1
    Nope...how are groups showing up in your People Search Results? Do you have a screen shot? I have never seen groups in the results. Jan 11, 2016 at 17:39

3 Answers 3


I think this might be possile using SharePoint Result Sources using a Search Query that excludes Active Directory User Groups or any other object located in a certain Organization Unit (OU)

  • Do you think this will be applicable and work in Office 365? Jan 8, 2016 at 13:29

Take a look at the accounts. In my case they all start with "_spo". Open your search center and edit the People Search results web part. Add an exclusion to the query like -accountname:_spo*. in my environment that excludes them. Another alternative is to copy the existing People Result Source and edit your copy adding the above exclusion. Then change the Result Source that the web part uses.

In this same way you should be able to exclude external (or guest) accounts with a query exclusion like: -accountname:EXT (or in our case we tag all external users as "(EXTERNAL)" so our exclusion is -PreferredName:" (EXTERNAL)")

Bottom line, create a query that only selects the accounts you wish to exclude and then negate it.


Try to set “ShowInAddressList” Azure AD User object property to false for accounts you do not want to see in Microsoft 365 Search.

“ShowInAddressList” Azure AD User object property is editable and synchronized to “SPS-HideFromAddressLists” SharePoint User Profile property (takes minutes)

“Show in Global Address List” under m365 Admin Center and “Hide from global address list (GAL)” under Exchange Admin Center respect “ShowInAddressList” Azure AD User object property change (but not vise versa).

Hide User Accounts from Microsoft 365 People Search

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.