SharePoint - 如何enable当前server的Timer service instance?

对于企业维护SharePoint环境过程中,可能会遇到计划在SharePoint Farm的server中开启Timer Service Instance的情况,来实现在server中设置Schedule timer job。

那么如何在server中enable timer service instance呢?

可以通过执行下面script实现:

1. 使用administrator打开Windows Powershell;

2. 执行下面Script;

Add-PSSnapin Microsoft.SharePoint.PowerShell

 

$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"

}

3. Timer services instance启动成功,可以进行后续timer job设置。

 

感谢阅读。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章