在 SharePoint Server 2016 中檢視計時器工作狀態View timer job status in SharePoint Server 2016

摘要: 了解如何使用 SharePoint 管理中心網站或 Windows PowerShell 來檢視 SharePoint Timer 工作狀態。Summary: Learn to view SharePoint timer job status by using the SharePoint Central Administration website or Windows PowerShell.

計時器工作可執行 SharePoint Server 2016 的特定 Windows 服務。此計時器工作包含該服務要執行的定義,並指定啟動該服務的頻率。SharePoint Timer Service 可執行計時器工作。SharePoint Server 2016 中的許多功能需仰賴計時器工作以根據排程執行服務。您可以使用管理中心網站或 PowerShell 來檢視已經執行的計時器工作的狀態。A timer job runs a specific Windows service for SharePoint Server 2016. The timer job contains a definition of the service to run and specifies how frequently the service is started. The SharePoint Timer Service runs timer jobs. Many features in SharePoint Server 2016 rely on timer jobs to run services according to a schedule. You can view the status of timer jobs that have been run by using the Central Administration website or PowerShell.

注意

[!附註] 因為 SharePoint Server 2016 在 Internet Information Services (IIS) 中以網站形式運作,所以管理員與使用者均依賴瀏覽器提供的協助工具功能。SharePoint Server 2016 支援所支援瀏覽器的協助工具功能。如需詳細資訊,請參閱下列資源: > 規劃瀏覽器支援> SharePoint 產品中的協助工具功能> 快速鍵> 觸控Because SharePoint Server 2016 runs as websites in Internet Information Services (IIS), administrators and users depend on the accessibility features that browsers provide. SharePoint Server 2016 supports the accessibility features of supported browsers. For more information, see the following resources: > Plan browser support> Accessibility features in SharePoint Products> Keyboard shortcuts> Touch

使用管理中心檢視計時器工作狀態View timer job status by using Central Administration

您可以使用管理中心來檢視計時器工作狀態。You can view timer job status by using Central Administration.

使用管理中心檢視計時器工作狀態To view timer job status by using Central Administration

  1. 確認執行此程序的使用者帳戶為伺服器陣列管理員群組的成員。Verify that the user account that is performing this procedure is a member of the Farm Administrators group.

  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. Or, in the Quick Launch, click Scheduled Jobs, Running Jobs, or Job History.

使用 Windows PowerShell 檢視計時器工作狀態View timer job status by using Windows PowerShell

您可以使用 PowerShell 檢視計時器工作狀態。You can view timer job status by using PowerShell.

使用 Windows PowerShell 檢視計時器工作狀態To view timer job status by using Windows PowerShell

  1. 確認您具備下列成員資格:Verify that you have the following memberships:

    • SQL Server 執行個體上的 securityadmin 固定伺服器角色。securityadmin fixed server role on the SQL Server instance.

    • 所有要更新之資料庫上的 db_owner 固定資料庫角色。db_owner fixed database role on all databases that are to be updated.

    • 正在執行 PowerShell Cmdlet 之所在伺服器上的系統管理員群組。Administrators group on the server on which you are running the PowerShell cmdlets.

      系統管理員可以使用 Add-SPShellAdmin Cmdlet 來授與權限。An administrator can use the Add-SPShellAdmin cmdlet to grant permissions.

      注意

      [!附註] 如果您不具備上述權限,請連絡安裝程式系統管理員或 SQL Server 系統管理員要求權限。如需 PowerShell 權限的其他資訊,請參閱 Add-SPShellAdminIf you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions. For additional information about PowerShell permissions, see Add-SPShellAdmin.

  2. 啟動 SharePoint 2016 管理命令介面。Start the SharePoint 2016 Management Shell.

    • 在 [開始] 畫面上,按一下 [SharePoint 2016 管理命令介面]。On the Start screen, click SharePoint 2016 Management Shell.
  3. 在 PowerShell 命令提示字元處,輸入下列命令:At the PowerShell command prompt, type the following command:

    Get-SPTimerJob -Identity <SPTimerJobPipeBind> | Format-Table DisplayName,Id,LastRunTime,Status
    

    其中 <SP 計時器工作管道繫結> 可以是格式為 12345678-90ab-cdef-1234-567890bcdefgh 的有效 GUID;有效的計時器工作名稱 (例如 TimerJob1);或有效之 SPTimerJob 物件的執行個體。Where <SPTimerJobPipeBind> can be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a timer job (for example, TimerJob1); or an instance of a valid SPTimerJob object.

    您可以使用 Identity 參數的值來指定計時器工作。如果未使用 Identity 參數,則會傳回所有計時器工作。You can use the value of the Identity parameter to specify a timer job. If you do not use the Identity parameter, all timer jobs are returned.

    若要檢視特定計時器工作的歷程記錄,請輸入下列命令:To view the history of a specific timer job, type the following command:

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

    其中 <SP 計時器工作管道繫結> 可以是格式為 12345678-90ab-cdef-1234-567890bcdefgh 的有效 GUID;有效的計時器工作名稱 (例如 TimerJob1);或有效之 SPTimerJob 物件的執行個體。Where <SPTimerJobPipeBind> can be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a timer job (for example, TimerJob1); or an instance of a valid SPTimerJob object.

如需詳細資訊,請參閱<Get-SPTimerJob>。For more information, see Get-SPTimerJob.

注意

[!附註] 建議您在執行命令列管理工作時使用 Windows PowerShell。Stsadm 命令列工具已過時,但為與舊版產品相容,仍會隨附提供。We recommend that you use Microsoft PowerShell when performing command-line administrative tasks. The Stsadm command-line tool has been deprecated, but is included to support compatibility with previous product versions.

注意

請注意 Get-sptimerjob > 指令程式將顯示您記錄檔中 GMT 時區而 SharePoint 管理中心將本地時間中顯示的所有事件。Please be aware that Get-SPTimerJob commandlet will show you logs in GMT time zone whereas SharePoint Central Administration will show all events in local time.