SharePoint – Import a complete list of file type exclusion

As you already know, you can exclude some additional file type from SharePoint crawling.

Unfortunately, this can be done only one file type per one file type through the search service administration.

If you have a lot of file type to exclude, this will take lot of time and is not really pleasant.

So, PowerShell and a file text are your friend Smile:

  • Create file text which contains all exclusion type to import; one per line
  • Open the SharePoint Management Shell and type the following CDMLet

$searchapp =  Get-SPEnterpriseSearchServiceApplication <your search service application>

$aFile = Get-Content <path to the text file>   

for ($i = 0 ; $i -lt $aFile.length ; $i++)

{$searchapp | New-SPEnterpriseSearchCrawlExtension $aFile[$i]}


That’s it.


Leave a Comment

Your email address will not be published. Required fields are marked *