Last active
August 29, 2015 14:14
-
-
Save kliemohn/c76eb86088a743b6aa55 to your computer and use it in GitHub Desktop.
Finds SharePoint ULS logs with request URLs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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