管理计时器作业在升级后未运行

原始 KB 编号: 2616609

症状

每个 SharePoint 服务器都有一个 SPTimerServiceInstance 对象,该对象代表 SPTimerV4 Windows 服务。 在某些情况下, (通常在升级) 之后,最终可能会遇到计时器服务在服务器上运行但 SPTimerSericeInstance 对象未联机的情况。 在这种情况下,依赖于要完成的计时器作业 ((例如启动用户配置文件同步服务) )的任何管理操作都不会成功。

原因

升级期间发生意外事件,阻止计时器服务实例对象重新联机。

解决方案

可以在场中的 SharePoint 服务器之一上运行以下 PowerShell 脚本。 该脚本检测服务器场中未联机的计时器服务实例,并尝试将它们联机。 运行脚本后,在确定有问题的每台服务器上手动重启 SPTimerV4 Windows 服务 (SharePoint 2010 计时器) 。

$farm = Get-SPFarm
$disabledTimers = $farm.TimerService.Instances | where {$_.Status -ne "Online"}
if ($disabledTimers -ne $null)
{
foreach ($timer in $disabledTimers)
{
Write-Host "Timer service instance on server " $timer.Server.Name " is not Online. Current status:" $timer.Status
Write-Host "Attempting to set the status of the service instance to online"
$timer.Status = [Microsoft.SharePoint.Administration.SPObjectStatus]::Online
$timer.Update()
}
}
else
{
Write-Host "All Timer Service Instances in the farm are online! No problems found"
}