SHARE
TWEET

Untitled

a guest Jun 16th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top