Advertisement
private775

Show SharePoint log for last x minutes

Dec 18th, 2014
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ###################### SHOW LOG FOR LAST X MINUTES
  2.  
  3. Function Get-SPLogEventLast([int]$minutes) {
  4.     [int]$min = 5
  5.     if($minutes -ne $null) { $min = $minutes }
  6.     $title = "ULS for last $($min) minutes"
  7.     $tim = (Get-Date).AddMinutes(-1*$min)
  8.     Get-SPLogEvent -StartTime $tim|Select Timestamp,Area,Category,EventID,Level,Correlation,Message|Out-GridView -Title $title
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement