
Most of the time you shouldn’t need to get involved in anything like this, but upgrades/patches can often queue up one-time timer jobs that don’t get executed for some reason and can hold off other jobs (such as Add-in management) so they don’t run.
There a several different types of SharePoint Timer job. Most are periodic, running every X minutes/hours/days, etc. but there are also one-off jobs that configure SharePoint in some way, perform initialisation, etc. For example, after patching SharePoint there are nearly always a set of one-off jobs queued up to run.
Normally jobs run through without any issues but occasionally something can go wrong and one or more jobs can get stuck not being able to execute.
NOTE: it is worth mentioning that it isn’t a good idea to blindly kill/delete jobs from the queue as they may be performing important configuration duties. Take care to identify what each job is doing and only delete those that you are sure will not have an adverse impact on the server(s). If in doubt, don’t do it!
First you’ll need to query the one-time jobs queued up on the farm.
Add-PSSnapIn Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
Get-SPTimerJob | ? { $_.Schedule.Description -eq "One-time" } | select Id,Name,{$_.Schedule.Description},{$_.Schedule.Time},LastRunTime,DisplayName | Format-Table -AutoSize
Code language: PowerShell (powershell)
Once you’ve reviewed the queue and identified any jobs that could be causing issues, you can delete those that you need to like this:
Add-PSSnapIn Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
# checks the correct timer job has been selected.
$job = Get-SPTimerJob -Identity job-id
$job
$confirm = Read-Host "Are you sure you want to delete this timer job? (Y/N)"
# deletes the job.
if ($confirm.Trim().ToLower() -eq "y") { $job.Delete() }
Code language: PHP (php)