Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
  2.  
  3. #Configuration Parameters
  4. $ContentSourceName = "Local SharePoint sites"
  5. $ResultsCount = 10
  6.  
  7. #Get Search Service application and Content Source
  8. $SearchServiceApplication = Get-SPEnterpriseSearchServiceApplication
  9. $ContentSource = Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $searchServiceApplication | ? { $_.Name -eq $contentSourceName }
  10.  
  11. #Get Crawl History
  12. $CrawlLog = new-object Microsoft.Office.Server.Search.Administration.CrawlLog($searchServiceApplication)
  13. $CrawlHistory = $CrawlLog.GetCrawlHistory($ResultsCount, $ContentSource.Id)
  14.  
  15. #Export the Crawl History to CSV
  16. $CrawlHistory | Export-CSV "C:CrawlHistory.csv" -NoTypeInformation
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement