How to Export Timer jobs in specific time range ?

Run following command by specifying the start time and end time as per the need 🙂

All Timer Jobs :

Get-SPTimerJob | % { $_.HistoryEntries } | Where-Object {($_.StartTime –gt “MM/DD/YYYY hh:mm:ss”) -and ($_.EndTime -lt “MM/DD/YYYY hh:mm:ss”) } | Export-Csv “C:\TimerJobs.csv” –NoType

Failed Timer Jobs:

Get-SPTimerJob | % { $_.HistoryEntries } | Where-Object {($_.StartTime -gt “MM/DD/YYYY hh:mm:ss”) -and ($_.To -lt “MM/DD/YYYY hh:mm:ss”) -and ($_.Status -ne ‘Succeeded’)} | Export-Csv “C:\FailedTimerJobs.csv” –NoType

 

Happy SharePoint Running 🙂

Leave a Reply

Leave a Reply

Your email address will not be published. Required fields are marked *