Thursday, June 27, 2013

Enable Search for specific sharepoint 2010 list/library using Powershell

$site = New-Object Microsoft.SharePoint.SPSite("yoursiteurl")
$web = $site.openweb("")

$Library = "workingdocuments"
$DocLib = $web.lists[$Library]

Write-Host "title"  $DocLib
Write-Host  "search" $DocLib.NoCrawl
$DocLib.NoCrawl = $false #if it is false search will be enabled
Write-Host  "search enabled:" $DocLib.NoCrawl

$DocLib.update()


$web.dispose()
$site.dispose()


No comments:

Post a Comment

Followers