magritton
3/30/2015 - 3:55 PM

SharePoint Log Merge by Correlation ID. This is good for searching logs for an error.

SharePoint Log Merge by Correlation ID. This is good for searching logs for an error.


$path = "C:\temp\temp.log"
$pathExists = Test-Path c:\temp -pathType container
if($pathExists -eq $false){
    Write-Host "Creating temp directory" -BackgroundColor Magenta -ForegroundColor Yellow
    $dir = New-Item c:\temp -type directory
}

If (Test-Path $path){
	Remove-Item $path
}

Merge-SPLogFile -path $path -Correlation a93fa39d-866b-80c0-3248-b878d37afbc6
Get-Content $path
notepad $path
$path = "C:\temp\temp.log"
If (Test-Path $path){
	Remove-Item $path
}

Merge-SPLogFile -path $path -Overwrite -EventID 1 -StartTime "08/17/2016 11:39" -EndTime "08/17/2016 16:20"
Get-Content $path
Merge-SPLogFile -path "C:\temp\temp.log" -Overwrite -Area eRDR