Skip to content

Vladilen

Microsoft 365 Governance, Purview, Search, SharePoint, Copilot, Automation, PowerShell, Azure etc.

  • Home
  • Microsoft 365
  • SharePoint
  • Birding
  • About
    • about me
    • Contact

How to remove service accounts from people search in SharePoint or Office 365 (Classic search)

Update: for the same solution in modern search – please refer to “Hide non-personal accounts from modern Microsoft 365 search”

The following solution is for Classic Search only. 

What I did is:

User profile services -> Manage User properties: create custom property like “HideFromPeopleSearch”, boolean, do not allow users to edit value, Indexed

Client-side PowerShell script using PnP library:
Connect-PnPOnline -Url https://domain-admin.sharepoint.com
…
$nonPeople = Get-ADUser -filter … # based on what’s in your AD and how you separate people and non-people accounts
foreach($account in $nonPeople) {
  Set-PnPUserProfileProperty -Property ‘HideFromPeopleSearch’ -Value ‘True’ -Account $account.UserPrincipalName
}

SearchCenter -> Site Settings -> Search Schema: use any pre-created RefinableString managed property (e.g. RefinableString33), add mapping to crawled property people:HideFromPeopleSearch,

SearchCenter -> Site Settings -> Search Query rules: Local People Results, new Query rule, change ranked results by changing query, {searchTerms} -RefinableString33=True

should work

See also:

  • m365 People Search and custom AAD and User Profiles Properties
This entry was posted in Microsoft 365, SharePoint, Software and tagged Microsoft Search, People Search, Search, Search Schema, User Profile on January 2, 2018 by Vladilen.com.

Post navigation

← Microsoft SharePoint, Microsoft 365: studying, certification SPO Modern Site Pages Enable Disable →

Recent Posts

  • SAM – Data Access Governance – Content Shared with EEEU
  • SharePoint Advanced Management
  • Microsoft 365 admin center displays incorrect sensitivity label
  • Tableau Cloud Connection to SharePoint
  • Solving Issues with m365 Copilot Agents
  • Python connect to SharePoint via Graph API with Delegated Permissions
  • Azure ACS retirement: Track down ACS apps
  • SelectedOperations.Selected permissions in SharePoint

Categories

  • Azure
  • Birding
  • Career
  • Flowers
  • Gallery
  • Microsoft 365
  • Microsoft Graph
  • Personality
  • Security
  • SharePoint
  • Software
  • TheWorld
  • Thought
  • Uncategorized

Tags cloud

ACS Azure Daemon App Data lifecycle management Microsoft 365 Governance Microsoft Graph Microsoft Graph API Microsoft Search Orphan Ownerless Sites and Groups in Microsoft 365 Ownerless groups Ownerless groups policy PnP PnP.PowerShell PowerShell Python Retention Policies Search Sites.Selected Troubleshooting

DM_Zoo_85x85.jpg Proudly powered by WordPress