Compartilhar via


SharePoint - Search PerformanceLevel

# you use Central Admin and click. But I was asked 'how do you do that with PowerShell'?

#SP2010
Add-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
Get-SPEnterpriseSearchService | Set-SPEnterpriseSearchService –PerformanceLevel “Maximum”

#SP2007
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$SPfarm = [Microsoft.SharePoint.Administration.SPFarm]::Local
$Search = $SPfarm.Services | where  {$_ -is [Microsoft.SharePoint.Search.Administration.SPSearchService]}
$Search.PerformanceLevel = [Microsoft.SharePoint.Search.Administration.SearchPerformanceLevel]::Maximum
$Search.Update()