Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
- #Configuration Parameters
- $ContentSourceName = "Local SharePoint sites"
- $ResultsCount = 10
- #Get Search Service application and Content Source
- $SearchServiceApplication = Get-SPEnterpriseSearchServiceApplication
- $ContentSource = Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $searchServiceApplication | ? { $_.Name -eq $contentSourceName }
- #Get Crawl History
- $CrawlLog = new-object Microsoft.Office.Server.Search.Administration.CrawlLog($searchServiceApplication)
- $CrawlHistory = $CrawlLog.GetCrawlHistory($ResultsCount, $ContentSource.Id)
- #Export the Crawl History to CSV
- $CrawlHistory | Export-CSV "C:CrawlHistory.csv" -NoTypeInformation
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement