Collect SharePoint Verbose ULS logs for reproducible issues

Summary

If you need to collect VerboseEX logs from a SharePoint Farm, this script makes it simple for reproducible issues. Simply execute the script, reproduce the issue and hit enter …. Done!

What does the script do?

  1. Obtain the current time for the “starttime” parameter in the format that the merge command requires.  
  2. Set the level to VerboseEX
  3. Pause the script while you reproduce the issue.
  4. Determine if a “c:\logs\uls” folder currently exists, if not create one.
  5. The Admin will hit “Enter” to continue after the issue was reproduced.
  6. The script will sleep for 15 seconds to ensure the action if fully completed and written to the logs.
  7. Obtain the current time for the “endtime” parameter in the format that the merge command requires.
  8. Execute Merge-SPLogfile command using our specified start and end times.
  9. Set the logging level back to default.

The Script

Output Example

I hope you found this script useful!

1 Comment


  1. Love it! Simple and effective. Thanks for sharing!

    Reply

Leave a Reply