Quantcast
Viewing all articles
Browse latest Browse all 72

Exclude users from SharePoint search results using crawl rules

We are using the default AD import for an environment to crawl user profiles. The customer requested the ability to exclude some users from the search results. This can be done by changing the search web part to exclude these users or by changing the user profile synchronization or by excluding these profiles using crawl rules. This blog shows you how to exclude users from SharePoint search results using crawl rules.

I’ve 4 accounts at this environment which I can query using the SharePoint Search Query Tool.

Image may be NSFW.
Clik here to view.
You will have to go to the Central Administration and then to the search administration.

Image may be NSFW.
Clik here to view.
Click on “Crawl Rules” under Crawling

Image may be NSFW.
Clik here to view.
Next click on “New Crawl Rule”

Image may be NSFW.
Clik here to view.
Add the correct path which is normally https://<MySitesHostURL>:<PortNumber>/person.aspx[?]accountname=<Domain>%5C<LoginName>
On my test environment this would be: https://mysites.sharepointfire.com:443/person.aspx[?]accountname=spfire%5Cmpadmin

Select “Use regular expressions…” and “Exclude complex URLs…” and click on OK

Next start a full crawl on the content source where you configured the people search (I suggest creating a content source just for the people search) and afterwards the user will be no longer queryable using search which can also be verified in the crawl log.Image may be NSFW.
Clik here to view.
and the SharePoint Search Query Tool

Image may be NSFW.
Clik here to view.

There is also a PowerShell command to create these exclusions automatically based for example on a property from Active Directory which can be found at https://docs.microsoft.com/en-us/powershell/module/sharepoint-server/new-spenterprisesearchcrawlrule?view=sharepoint-ps

 

The post Exclude users from SharePoint search results using crawl rules appeared first on SharePoint Fire.


Viewing all articles
Browse latest Browse all 72

Trending Articles