web-dev-qa-db-ja.com

コマンドラインからSharePoint Timer Serviceを再起動するにはどうすればよいですか?

コマンドラインからSharePoint Timer Serviceを再起動するにはどうすればよいですか?

7
vitule

net stop "Windows SharePoint Services Timer"

net start "Windows SharePoint Services Timer"

9
DanBig

SharePoint 2010:

net stop SPTimerV4
net start SPTimerV4
14
Crop Duster

OPがコマンドラインソリューションを要求していることを理解していますが、PowerShell(管理者として実行)を使用すると、タイマーサービスの再起動は実行と同じくらい簡単です。

restart-service sptimerv4

9
Sune Rievers

SharePoint 2013:ネットストップSPTimerV4/ネットスタートSPTimerV4

SharePoint 2007:net stop SPTimerV/net start SPTimerV

SharePoint 2003:ネットストップSPTimer/ネットスタートSPTimer

5
Brandon

そして、SP2010/2013がすべてのマシンに対してこれを行うには:

$farm = Get-SPFarm
$farm.TimerService.Instances | foreach { $_.Stop(); $_.Start(); }
2
Mark Mascolino
REM - Save this in a .BAT file and set up a scheduled task that runs it periodically.
REM - This will recycle the SharePoint Timer Service, and also log it in the Event Viewer. 

EVENTCREATE /T INFORMATION /L APPLICATION /ID 777 /D "Starting scheduled task: SP timer restart."

net stop SPTimerV4
net start SPTimerV4

if %ERRORLEVEL% == 0 (
  EVENTCREATE /T INFORMATION /L APPLICATION /ID 777 /D "Scheduled task: Restart succeeded for the SharePoint Timer Service (SPTimerV4 AKA 'SharePoint 2010 Timer').  ERRORLEVEL=%ERRORLEVEL%.  The restart is done by Scheduled Task, which runs the batch file: C:\_________________ every _ hours."
exit /b
) else (
  EVENTCREATE /T ERROR /L APPLICATION /ID 777 /D "Scheduled task: Restart failed for the SharePoint Timer Service (SPTimerV4 AKA 'SharePoint 2010 Timer').  ERRORLEVEL=%ERRORLEVEL%.  Please stop and restart the service manually and investigate the issue preventing the restart. The restart is done by Scheduled Task, which runs the batch file: C:\___________________ every _ hours."
)
EXIT
1
Ben