Alle laufenden Crawls stoppen

Schnell mal alle laufenden Crawls in der SharePoint-Farm stoppen?
Einfach:

Get-SPServiceApplication | `
? { $_.TypeName -match "^Search Service" } | `
% { Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $_ } | `
? { $_.CrawlStatus -ne "Idle" } | `
% { Write-Host -NoNewline "Stopping $($_.Name) "; $_.StopCrawl(); do {Write-Host -NoNewline "."; Start-Sleep -Seconds 1} while ($_.CrawlStatus -ne "Idle"); Write-Host " stopped." }
view raw Stop-AllCrawls.ps1 hosted with ❤ by GitHub