在 SharePoint Server 2016 中檢視計時器工作狀態

適用于:yes-img-132013 yes-img-16 2016yes-img-192019 yes-img-se訂閱版本 no-img-sopMicrosoft 365 中的 SharePoint

計時器工作可執行 SharePoint Server 2016 的特定 Windows 服務。 此計時器工作包含該服務要執行的定義,並指定啟動該服務的頻率。 SharePoint Timer Service 可執行計時器工作。 SharePoint Server 2016 中的許多功能需仰賴計時器工作以根據排程執行服務。 您可以使用管理中心網站或 PowerShell 來檢視已經執行的計時器工作的狀態。

注意事項

[!附註] 因為 SharePoint Server 2016 在 Internet Information Services (IIS) 中以網站形式運作,所以管理員與使用者均依賴瀏覽器提供的協助工具功能。 SharePoint Server 2016 支援所支援瀏覽器的協助工具功能。 如需詳細資訊,請參閱下列資源: > 在 SharePoint鍵盤快速鍵>Touch的 SharePoint>>協助工具中規劃瀏覽器支援> 協助工具指導方針。

使用管理中心檢視計時器工作狀態

您可以使用管理中心來檢視計時器工作狀態。

使用管理中心檢視計時器工作狀態

  1. 確認執行此程序的使用者帳戶為伺服器陣列管理員群組的成員。

  2. In Central Administration, on the home page, click Monitoring.

  3. On the Monitoring page, in the Timer Jobs section, click Check job status.

  4. Timer job status is divided into three groups: Scheduled, Running, and History. To page through the timer job status data rows, click the paging arrows at the bottom of these groups.

  5. To view the timer job status for a specific group, click the title of the group. 或者,在 [快速啟動] 上,按一下 [排程的工作]、[執行工作] 或 [工作歷程記錄]

使用 Windows PowerShell 檢視計時器工作狀態

您可以使用 PowerShell 檢視計時器工作狀態。

使用 Windows PowerShell 檢視計時器工作狀態

  1. 確認您具備下列成員資格:
  • SQL Server 執行個體上的 securityadmin 固定伺服器角色。

  • 所有要更新之資料庫上的 db_owner 固定資料庫角色。

  • 正在執行 PowerShell Cmdlet 之所在伺服器上的系統管理員群組。

    系統管理員可以使用 Add-SPShellAdmin Cmdlet 來授與權限。

    注意事項

    [!附註] 如果您不具備上述權限,請連絡安裝程式系統管理員或 SQL Server 系統管理員要求權限。 如需 PowerShell 權限的其他資訊,請參閱 Add-SPShellAdmin

  1. 啟動 SharePoint 2016 管理命令介面。
  • 在 [開始] 畫面上,按一下 [SharePoint 2016 管理命令介面]。
  1. 在 PowerShell 命令提示字元中,輸入下列命令:
Get-SPTimerJob -Identity <SPTimerJobPipeBind> | Format-Table DisplayName,Id,LastRunTime,Status

其中 < SPTimerJobPipeBind >可以是有效的 GUID,格式為 12345678-90ab-cdef-1234-567890bcdefgh;計時器工作的有效名稱 (例如 TimerJob1) ;或有效 SPTimerJob 物件的實例。

您可以使用 Identity 參數的值來指定計時器工作。 如果未使用 Identity 參數,則會傳回所有計時器工作。

若要檢視特定計時器工作的歷程記錄,請輸入下列命令:

(Get-SPTimerJob -Identity <SPTimerJobPipeBind>).HistoryEntries | Format-Table -Property Status,StartTime,EndTime,ErrorMessage

其中 < SPTimerJobPipeBind >可以是有效的 GUID,格式為 12345678-90ab-cdef-1234-567890bcdefgh;計時器工作的有效名稱 (例如 TimerJob1) ;或有效 SPTimerJob 物件的實例。

如需詳細資訊,請參閱<Get-SPTimerJob>。

注意事項

[!附註] 建議您在執行命令列管理工作時使用 Windows PowerShell。 Stsadm 命令列工具已過時,但為與舊版產品相容,仍會隨附提供。

注意事項

請注意,Get-SPTimerJob命令程式會在 GMT 時區中顯示記錄,而 SharePoint 管理中心則會以當地時間顯示所有事件。