Skip to content

Instantly share code, notes, and snippets.

@cmd64
Created April 25, 2019 14:39
Show Gist options
  • Save cmd64/5ec17919e7d3b180367f0f6c9392baff to your computer and use it in GitHub Desktop.
Save cmd64/5ec17919e7d3b180367f0f6c9392baff to your computer and use it in GitHub Desktop.
SharePoint get log files from all servers
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
{
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
#Merges the log data for last one hour
Merge-SPLogFile -Path "C:\FarmMergedLog.csv" -Overwrite -Level Critical
#Merges the log data for particular time range, which is culture-specific to windows timezone.
Merge-SPLogFile -Path "C:\FarmMergedLog2.csv" -Overwrite -Level Critical -StartTime "01.04.2019 00:00" -EndTime "25.04.2019 00:00"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment