Skip to content

Instantly share code, notes, and snippets.

@kliemohn
Last active August 29, 2015 14:14
Show Gist options
  • Save kliemohn/c76eb86088a743b6aa55 to your computer and use it in GitHub Desktop.
Save kliemohn/c76eb86088a743b6aa55 to your computer and use it in GitHub Desktop.
Finds SharePoint ULS logs with request URLs
Add-PSSnapin Microsoft.SharePoint.PowerShell
#get-splogevent -starttime "1/9/2015 4:11:00 PM" -endtime "1/9/2015 4:11:10 PM" -MinimumLevel High |
get-splogevent -MinimumLevel High |
?{$_.Message -like "*Bad response from SMTP*"} |
ForEach-Object {
$log = $_
get-splogevent -starttime $log.Timestamp.AddSeconds(-30) -endtime $log.Timestamp |
?{$_.Correlation -eq $log.Correlation -and $_.Message -like "Name=*"} |
ForEach-Object {
Write-Output "$($log.Timestamp) $($log.Message) $($_.Message)"
Write-Host "$($log.Timestamp) $($log.Message) $($_.Message)"
}
} | Out-File C:\LogOutput\SMTPErrorRequests.txt​
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment