<!DOCTYPE html> <html> <head> </head> <body> <p><strong>ISSUE:</strong></p> <p>After a Sharepoint migration from version 2016 to 2019, it can happen that timer jobs, which are automatically scheduled, are not executed on all databases available for a web-application.</p> <p>In our case, the 'immediate alerts' no longer worked, as they pointed to the table 'Mysites' and not 'Intranet' (which is the main one).</p> <p>Autogenerated jobs from Sharepoint were not present, but were only present for the table 'MySites'. Using the following script, all jobs and all tables in the database are automatically regenerated.</p> <p>This reprovisions all instances on online, and recreates all scheduled jobs.</p> <p>$farm = Get-SPFarm<br />$FarmTimers = $farm.TimerService.Instances<br />foreach ($FT in $FarmTimers)<br />{<br />write-host "Server: " $FT.Server.Name.ToString();<br />write-host "Status: " $FT.status;<br />write-host "Allow Service Jobs: " $FT.AllowServiceJobs;<br />write-host "Allow Content DB Jobs: " $FT.AllowContentDatabaseJobs;"`n"<br />}<br />$disabledTimers = $farm.TimerService.Instances | where {$_.Status -ne "Online"}<br />if ($disabledTimers -ne $null)<br />{<br />foreach ($timer in $disabledTimers)<br />{<br />Write-Host -ForegroundColor Red "Timer service instance on server " $timer.Server.Name " is NOT Online. Current status:" $timer.Status<br />Write-Host -ForegroundColor Green "Attempting to set the status of the service instance to online…"<br />$timer.Provision()<br />$timer.Start()<br />write-host -ForegroundColor Red "You MUST now go restart the SharePoint timer service on server " $FT.Server.Name}}<br />else<br />{<br />Write-Host -ForegroundColor Green "All Timer Service Instances in the farm are online. No problems found!"<br />}</p> <p>When finished, restart the "Sharepoint Timer Service" on server.</p> <p>When you return to the administration page, you will see the correctly regenerated jobs.</p> </body> </html>
Great