Disable list or libraries to appear in search result SharePoint Online Office 365

sharepoint online office 365 disable search in list
InfoPath alternatives for form designing SharePoint

All list and libraries search settings is enabled to appear in search result.
But there could be few list and library which you might like to display in search result.
SharePoint out of the box list settings option is available where you can enable/disable the option.

Go to List settings -> Advance Settings -> Select yes/No for Search section. Refer below screenshot for further reference.

sharepoint online office 365 disable search in list
sharepoint online office 365 disable search in list

You can also see Switch the default experience for site from new or classic SharePoint Online Office 365.

If you have lot many list and libraries where this changes needs to be done. Let’s write CSOM and PowerShell script to automate the process.

cls

$0 = $MyInvocation.MyCommand.Definition

$dp0 = [System.IO.Path]::GetDirectoryName($0)

$username = “sambita@***.com”

$password = “****”

#$url = $xmldata.WebSite.Url

$url =’https://***.sharepoint.com/sites/test/’

$securePassword = ConvertTo-SecureString $password -AsPlainText -Force

# connect/authenticate to SharePoint Online and get ClientContext object..

$clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($url)

$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $securePassword)

$clientContext.Credentials = $credentials

Add-Type -Path “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll”

Add-Type -Path “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll”

Add-Type -Path “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Publishing.dll”

Add-Type -Path “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Taxonomy.dll”

if (!$clientContext.ServerObjectIsNull.Value)

{

Write-Host “Connected to SharePoint Online site: ‘$Url'” -ForegroundColor Green

$web = $clientContext.Web

$clientContext.Load($web)

$list=$clientContext.Web.Lists.GetByTitle($ListName)

$list.NoCrawl = $NoCrawl

$list.Update()

$clientContext.ExecuteQuery()

}

Similar SharePoint 2013 Tutorials


About Sambita Rath

I have 9 years of exprience into SharePoint implementation, architecture, Administrator, development and Training.Designing Information Architecture in SharePoint 2007, 2010,2013 and Office 365.

View all posts by Sambita Rath →

Leave a Reply