SharePoint 2013 Correlation ID – Get Detailed Error using PowerShell

Correlation IDs are introduced in SharePoint 2010 to uniquely identify each error encountered. Later, these correlation IDs are used as a starting point reference to get the complete error details from ULS logs during troubleshooting issues.

How to check correlation ID in SharePoint 2013?

While it’s possible to open and search ULS logs correlation IDs with notepad, There are some easy ways and tools to lookup correlation ID errors in SharePoint 2013.

Here is a typical SharePoint 2013 “sorry something went wrong” error page with correlation ID.

sharepoint 2013 sorry something went wrong correlation id - powershell to get detailed error from uls log correlation id

Find SharePoint 2013 correlation ID using PowerShell

Just get the correlation ID SharePoint 2013 from the error page and pass it to the PowerShell cmdlet: Get-SPLogEvent. Here are some examples: Login to your SharePoint server(s), Open SharePoint 2013 management shell and replace the GUID with your correlation ID.

#Get all details of the error
Get-SPLogEvent | ?{$_.Correlation -eq "6922c76b-32f7-4e2e-af96-fbda88a77fa5"}

#Retrieve selective columns of the error 
Get-SPLogEvent | ?{$_.Correlation -eq "f53b559c-f70e-002f-694c-7d3b8b55f534"} | select Area, Category, Level, EventID, Message | Format-List

#Get sharepoint 2013 correlation id in error messages and send to file
Get-SPLogEvent | ? {$_Correlation -eq "3410f29b-b756-002f-694c-7a574ff74cab" } | select Area, Category, Level, EventID, Message | Format-List > C:\SPError.log

#Get all issues logged in the past 10 minutes
Get-SPLogEvent -starttime (Get-Date).AddMinutes(-10)

#Get Events between specific time frames
Get-SPLogEvent -StartTime "03/06/2015 18:00" -EndTime "03/06/2015 18:30" 

Find and Extract ULS LOG in Multi-Server SharePoint Farm:

Please note, All these cmdlets search for a given correlation ID on a specific SharePoint server where you run the PowerShell script. To search and extract LOG from all SharePoint Servers, matching the given correlation ID, use:

Merge-SPLogFile -path "D:\ErrorLog.txt" -Correlation "Your-error-correlation-id"

SharePoint 2013 correlation ID viewer
There are some good tools out there.

SharePoint 2013 correlation ID location:
Usually, ULS logs are located at 14/15 hive’s LOGs folder. E.g: “C:\Program Files\Common files\Microsoft Shared\Web Server Extensions\15\LOGS”.

SharePoint 2013 correlation ID not in the log?
ULS logs are specific to per WFE (Web Front End) server. So, In a multi-Server SharePoint farm, When users hit SharePoint 2013 sites and ended up in an error page, that can be served by any one of the front end, with the error logged in the ULS logs folder of the particular web front end. So, if SharePoint 2010 correlation id not in log, you got query all web front end’s ULS logs with the specific correlation ID. Use the below method of querying SQL Server to get the error details regardless of the server.

Query SQL Server Database for a specific correlation ID:
In SharePoint 2013 search correlation id error can also be done by querying the Logging database. Its usually with name: WSS_Logging unless you change it! Query from ULSTraceLog view as:

SELECT [MachineName], 
    [Area],
    [Category],
    [Level],
    [EventId],
    [Message],
    [CorrelationId] 
FROM ULSTraceLog 
WHERE [CorrelationId] = '39C29F9C-6890-D07A-0D7C-5A3A7AB7BFF5'

Salaudeen Rajack

Information Technology Professional with Two decades of SharePoint Experience.

3 thoughts on “SharePoint 2013 Correlation ID – Get Detailed Error using PowerShell

  • June 13, 2018 at 10:20 AM

    Sir, How can i find the reason if i am getting the correlation errors on a page in sharepoint online…Please advice

    Reply
  • January 31, 2018 at 11:59 AM

    shared clear information. Thank you so much!!

    Reply
  • December 12, 2014 at 4:06 AM

    excellent post! Thanks!

    Reply

Leave a Reply