Export SharePoint Search Crawl log to CSV File.

1 comment
Hi All,
In a following Post ,We will see about how to export SharePoint Search Crawled log Items to CSV. We are going to achieve this by using PowerShell Script.


Add-PSSnapin Microsoft.SharePoint.Powershell
$ssa = Get-SPEnterpriseSearchServiceApplication
$cl = New-Object Microsoft.Office.Server.Search.Administration.CrawlLog $ssa
$cl.GetCrawledUrls($false,1000000,"",$false,-1,0,-1,[datetime]::minvalue,[datetime]::maxvalue) | export-csv -notype successes.csv  $cl.GetCrawledUrls($false,1000000,"",$false,-1,1,-1,[datetime]::minvalue,[datetime]::maxvalue) | export-csv -notype warnings.csv
$cl.GetCrawledUrls($false,1000000,"",$false,-1,2,-1,[datetime]::minvalue,[datetime]::maxvalue) | export-csv -notype errors.csv

We can find the Path of our log files at below path C:\Windows\System32.

Reference :

Thanks.


Related Post

1 comment:

  1. Thanks for this!

    To anyone else intending on using .getCrawledUrls, don't forget to load:
    [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.Search.Administration.CrawlLog")

    at the start of your script.

    Furthermore, I personally used the '-Identity "Search Service Application"' argument when initializing $ssa. So it'd look like this:

    $ssa = Get-SPEnterpriseSearchServiceApplication -Identity "Search Service Application"

    Anyways, thanks for this post Kaarthikeya! I was going nuts trying to find a way to access this crawl log error data.

    ReplyDelete