Consider a multi-server SharePoint FARM where you come across an error and SharePoint provides you just a Correlation ID. It can get very tedious for the administrator to find the actual error, especially scanning the logs on all servers.
There is a much easier option available in PowerShell which will return logs for a particular Correlation ID from the entire FARM.
Merge-SPlogfile - PowerShell commandThe "Merge-SPlogfile" command will search the error logs for the given correlation error ID from all the servers in FARM.
The output file can be generated in the desired format (log, xls, etc) and placed on any location on the server.
Merge-SPLogFile -Path [FILE PATH] -Correlation [CORRELATION GUID]where,
Merge-SPLogFile = PowerShell Command
Path = Location where the output file is to be saved, along with File Name and extension
Correlation = The correlation id (GUID) of the error
Example -
Start SharePoint Management Shell (run as administrator) and execute below PowerShell command.
Merge-SPlogfile -Path C:\sp_error.xls -Correlation xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
This will generate a file named "sp_error.xls" at location C:\. The generated file will consist only errors related to the correlation id provided in the command.
If you want to understand how the correlation id is helpful in troubleshooting the error, read here - http://code2care.org/2015/an-unexpected-error-has-occurred
Comments:
- Can I use this PowerShell command to get logs from SharePoint Online site collection?
anon 19 Aug 2020 22:09:43 GMT
- solution does not work. i use sharepoint online in office 365.
anon 03 Feb 2020 06:34:11 GMT
- Further comments disabled!
- Move Copy Migrate SharePoint OneDrive files folders to different site collection location
- How to generate client id and secret to register SharePoint App with OAuth
- How to share SharePoint site or document with all users in organization
- Get-ADUser PowerShell - Get AD user details using email address
- error CAML Query containing special characters
- Access URL for SharePoint Tenant Admin Center (Online Office 365)
- Fix SharePoint Error - The Managed Metadata Service or Connection is currently not available. The Application Pool or Managed Metadata Web Service may not have been started
- SharePoint - The URL is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.
- How to delete SharePoint List Item programmatically using C#.Net
- How to Share Microsoft SharePoint Site with Users or Groups
- JSON column formatting to preview SharePoint Online file on mouse hover
- SharePoint List redirect user after submitting form NewForm.aspx
- See actual SharePoint error exception modify web.config
- SharePoint Server 2016 IT Preview Deprecated Removed features
- How to create SharePoint Document Library
- How to Get or Set SharePoint Document ID _dlc_DocId using PowerShell
- How to disable SharePoint subsite creation option for owners
- PowerShell - How to use Try Catch Finally blocks for error exception handling (Windows/SharePoint)
- SharePoint error - Your organization doesn't allow sharing with users from this domain. Please contact your IT department for help. (OSE403)
- [Solved] SharePoint Search Internal server error exception
- How to wrap column text in SharePoint Online Modern List Grid View using JSON formatting
- How to extend retiring SharePoint 2010 Workflows and continue with Office 365
- Changed AD user display name showing old name in SharePoint
- How to hide or remove quick launch left navigation from SharePoint Online Modern site page
- How to enable anonymous public access for SharePoint Online site collection, file, folder without login ?
- How to word wrap in HTML - Html
- incorrect line ending: found carriage return (\r) without corresponding newline (\n) - Android
- How to install powershell on macOS - Powershell
- How to check installed Tomcat version - Tomcat
- Failed to install Android.apk on device 'emulator-5554': timeout - Android-Studio
- How to migrate Kaizala to Microsoft Teams - Teams
- Chrome move to next or previous tab using keyboard - Chrome
- [Solution] macOS could not be installed on your computer OSInstall.mpkg appears to be missing or damaged - MacOS