Export SharePoint 2007 Search Crawl History using PowerShell

Here is the PowerShell script to export Search crawl history in SharePoint 2007 using PowerShell:

    function global:Get-CrawlHistory($url)
     #Objects to get Crawl History
     $site = new-Object Microsoft.SharePoint.SPSite($url);
     $context = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($site);
     $history = new-Object Microsoft.Office.Server.Search.Administration.CrawlHistory($context);

     Write-OutPut $history.GetCrawlHistory()
     #Dispose site object
    #Call the function to get Crawl History
    Get-CrawlHistory -url "http://sharepoint.crescent.com" | Export-CSV "d:\Reports\CrawlLog.csv"
This gives data such as: CrawlType (2 - Increment, 1- FULL), ContentSourceID ( 4 - Local Crawls, 10 -People search), Status, Start Time, End Time, Success Count, Error Count, Warning Count of last 8 crawls.

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.