kwizcom banner advertisement

Export SharePoint 2007 Search Crawl History using PowerShell

Here is the PowerShell script to export Search crawl history in SharePoint 2007 using PowerShell:
    [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
    [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.Search")

    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
     $site.Dispose()
    }
    
    #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.
Export SharePoint 2007 Search Crawl History using PowerShell Export SharePoint 2007 Search Crawl History using PowerShell Reviewed by Salaudeen Rajack on June 25, 2013 Rating: 5

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.