From SPC14: “Troubleshoot Search” session (spc375)

Wow! I wanted to send a huge thank you to the >500 folks that attended our session today and for the very gracious feedback. Here is a link to our session on Channel9:

How to manage and troubleshoot Search: A practical guide (SPC375)
https://channel9.msdn.com/Events/SharePoint-Conference/2014/SPC375

 

And as promised, here's the PowerShell that I build for filtering the ULS by correlation Id and having it automatically open in ULS viewer. To run it, simply use:

.\getULSbyCorrelation.ps1 "f41cb190-945e-458e-b924-77ec2fd066d4"  

 

$pathToULSViewer = "D:\Toolbox\UlsViewer.exe"

if ($args[0] -ne $null) {

    if ($args[1] -ne $null) {

        $outputPath = $args[1]

    } else {

        $outputPath = Join-Path $Pwd.Path $("byCorrelation_" + $args[0] + ".log")

    }

    Merge-SPLogFile -Path $outputPath -overwrite -Correlation $args[0] | Out-Null 

    if (Test-Path $outputPath) { Invoke-Expression "$pathToULSViewer $outputPath" }

    else { Write-Warning ("=== Found No Matching Events for this Correlation ===") }

} else { Write-Warning ("=== No CorrelationId Provided ===") }  

 

And optionally, specify a target path for this run using:

.\getULSbyCorrelation.ps1 "f41cb190-945e-458e-b924-77ec2fd066d4" $fullPathAndFileNameForOutput

 

Very much appreciated to all - this was a REALLY rewarding experience!

--Brian and Jon