Home > SharePoint 2010, SharePoint Problems/Issues > Using PowerShell To Get Detailed Information about Correlation IDs in SharePoint 2010

Using PowerShell To Get Detailed Information about Correlation IDs in SharePoint 2010

I love PowerShell, and I love how now with SharePoint 2010 you are given a unique Correlation ID for errors that can be used in helping you search for these errors in the SharePoint ULS Logs.

However, I hate searching ULS Logs sure I can use ULS Viewer to help me track down my problem via filters, however why use that when you have PowerShell.

Follow these steps below, which will search the ULS logs for the Correlation ID and pipe it out into detailed columns with information relevant to the error.

1.  Log into your SharePoint or CA server doesn’t matter just as long as you can access the SharePoint 2010 Management Shell for your farm.
2.  Bring up SharePoint 2010 Managment Shell
3.  Next Type:  Get-SPLogEvent | ?{$_.Correlation -eq “correlation id of the error”} | ft Category, Message -Autosize
4.  Hit Enter

It might take a few minutes for PowerShell to grab the ULS logs and search for the Correlation ID.

You should then be presented with two columns (Category and Message) with detailed information about the error.  This should help you narrow down the problem.  This also eliminates having to open up all your ULS log files and searching or loading them up in ULS viewer.  It’s alot quicker and proficent in my opinion.

For a much clearner/readable output type this in step 3:

Get-SPLogEvent | ?{$_.Correlation -eq “correlation id of the error”} | select Area, Category, Level, EventID, Message | Format-List

If you would like to pipe it out to a text file do this:

Get-SPLogEvent | ?{$_.Correlation -eq “correlation id of the error”} | select Area, Category, Level, EventID, Message | Format-List > c:\CorrelationID.log

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: