Thursday, 10 March 2016

Disable Search for the Document Library using Powershell


Using below script we can disable the search for the Document library/List.

cls
Add-PsSnapin Microsoft.SharePoint.PowerShell

$site = Get-SPSite "<<Site URL>>"
$web= $site.openweb()  
        foreach ($list in $web.lists['Projectinfolist'])
        {                
                    $list.NoCrawl = $true
                    $list.Update()
        }  
        $web.Dispose()
    $site.Dispose()

No comments:

Post a Comment