How to find uls log details based on correlation id using PowerShell in SharePoint 2016/2013


This PowerShell SharePoint tutorial explains, how to find uls log details based on Correlation ID from ULS Logs in SharePoint 2013/2016 using PowerShell. This command will be very much helpful if you are working with multiple servers which are load balanced. Usually, logs file will be too big and to get log details for a particular Correlation ID is difficult for multiple servers.


New to Office 365 SharePoint Online? Get Office 365 Enterprise E3 Subscription & Try out all the features

If you are new to PowerShell, read an article on Working with PowerShell in SharePoint Online/2016/2013.

Whenever any error occurs in any SharePoint page, SharePoint through an error saying Something went wrong and then it will display a correlation id.

A correlation ID is like a unique GUID generated at the time of a request in SharePoint. Each correlation ID is unique to each request on a SharePoint farm. You can check an article on Correlation ID in SharePoint 2010.

PowerShell Script to Find ULS Log details based on Correlation ID in SharePoint

Below is the PowerShell command which will pick the error details for the particular Correlation ID from all the servers to a single place.

You can run the PowerShell command using Windows PowerShell ISE or using Visual Studio Code.

Add-PSSnapin “Microsoft.SharePoint.PowerShell”

Merge-SPLogFile -Path “E:\Bijay\TempError.txt” -Correlation ff3a479d-8e3b-a03f-6251-ce47ef2463c6 -Overwrite

Make sure you have write access to the E:\Bijay\ folder.

Once you run the command, it will pull the logs from all the servers and it will write in the text file.

Similarly, also you can use get-splogevent command to retrieve logs based on the correlation id.

Add-PSSnapin “Microsoft.SharePoint.PowerShell”

get-splogevent | ?{$_.Correlation -eq “3eb6479d-c31e-70c8-65fd-37f3a9241469”}

Add-PSSnapin “Microsoft.SharePoint.PowerShell”

get-splogevent | ?{$_.Correlation -eq “3eb6479d-c31e-70c8-65fd-37f3a9241469”} | select Area, Category, Level, EventID, Message | Format-List

Get-SPLogEvent -StartTime YYYY-MM-DDTHH:mm:ss | ?{$_.Correlation -eq “3eb6479d-c31e-70c8-65fd-37f3a9241469”} | select Area, Category, Level, EventID, Message | Format-List

You can also use the below command if you are trying in your local system rather in load balancer servers.
Add-PSSnapin “Microsoft.SharePoint.PowerShell”


get-splogevent | ?{$_.Correlation -eq “da80689d-e397-70c8-65fd-34a7bc8a5446”} | select Area, Category, Level, EventID,Message | Format-List > E:\errorlog.txt

You may like following SharePoint ULS log tutorials:

Hope this will be helpful to find uls log details based on a correlation id in SharePoint 2013/2016 using PowerShell.

Check out Best Alternative to InfoPath -> Try Now

FREE SHAREPOINT 2019 PDF

(Installation & Features)



About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →