Created
July 21, 2014 15:56
-
-
Save MaxMelcher/21d388100a60cc746f2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-PSSnapin microsoft.sharepoint.powershell -ea 0 | |
$ssa = Get-SPEnterpriseSearchServiceApplication | Where-Object {$_.Name -eq "Search Service Application"} | |
$id = Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $ssa | ? { $_.Name -eq "Local SharePoint Sites"} | |
$log = New-Object Microsoft.Office.Server.Search.Administration.CrawlLog $ssa | |
Write-Host "Success:" | |
$dt = $log.GetCrawledUrls($false, 10000, $null, $false, $id.Id, 0, -1, [System.DateTime]::MinValue, [System.DateTime]::MaxValue) | |
$dt.Rows.Count | Out-String | |
Write-Host "Warnings:" | |
$dt = $log.GetCrawledUrls($false, 10000, $null, $false, $id.Id, 1, -1, [System.DateTime]::MinValue, [System.DateTime]::MaxValue) | |
$dt.Rows.Count | Out-String | |
Write-Host "Errors:" | |
$dt = $log.GetCrawledUrls($false, 10000, $null, $false, $id.Id, 2, -1, [System.DateTime]::MinValue, [System.DateTime]::MaxValue) | |
$dt.Rows.Count | Out-String | |
Write-Host "Deleted:" | |
$dt = $log.GetCrawledUrls($false, 10000, $null, $false, $id.Id, 3, -1, [System.DateTime]::MinValue, [System.DateTime]::MaxValue) | |
$dt.Rows.Count | Out-String | |
Write-Host "Everything:" | |
$dt = $log.GetCrawledUrls($false, 10000, $null, $false, $id.Id, -1, -1, [System.DateTime]::MinValue, [System.DateTime]::MaxValue) | |
$dt.Rows.Count | Out-String | |
$group = $dt | Group-Object "ErrorID" | |
$errors = $log.GetErrorMessages() # <= this guy returns an internal Type: Microsoft.Office.Server.Search.Administration.ErrorInfo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment