zettelkasten/OneNoteExport/Kommunikationstechnologie/Sharepoint/HOWTo's/56_TimerJob History durchsuchen.md
Ralf Koop 5a108aa2b4 .
2023-08-25 23:29:11 +02:00

1.2 KiB

TimerJob History durchsuchen

Montag, 21. Oktober 2019

15:16

 

# Initial settings

$Wa = Get-SPWebApplication "http://WebAppUrl"    # Supply the web app url here

$From= "2/13/2013 12:00:00 AM"  # mm/dd/yyyy hh:mm:ss

 

$To = "2/14/2013 12:00:00 AM"

# Retrieve all jobs in the time range

 

Write-Host "Listing all timer jobs that have run between $From to $To and storing it in CSV format" -ForeGroundColor Blue

 

$Wa.JobHistoryEntries | Where-Object {($_.StartTime -gt $From) -and ($_.StartTime -lt $To)} | Export-Csv TimerJobHistory.csv --NoType

Write-Host "Done.." -ForeGroundColor Green

# Retrieve all failed jobs in the time range

 

Write-Host "Listing all timer jobs that have failed to run between $From to $To and storing it in CSV format" -ForeGroundColor Red

$Wa.JobHistoryEntries | Where-Object {($_.StartTime -gt $From) -and ($_.To -lt $To) -and ($_.Status -ne 'Succeeded')} | Export-Csv FailedTimerJobHistory.csv --NoType

Write-Host "Done.." -ForeGroundColor Green

 

Aus <https://blogs.technet.microsoft.com/praveenh/2013/02/14/retrieve-timer-job-history-for-a-specified-time-range-using-powershell/>