在 SharePoint Server 中啟動或停止服務Start or stop a service in SharePoint Server

摘要: 了解如何在 SharePoint Server 2016 和 SharePoint 2013 中啟動和停止服務。Summary: Learn how to start and stop a service in SharePoint Server 2016 and SharePoint 2013.

SharePoint Server 包括位於伺服器陣列中各伺服器上的服務。在某些情況下,您可以設定全域服務設定以及啟動或停止服務。SharePoint 管理中心網站 可以直接管理服務,而不必經由個別的管理網站管理。您也可以遠端監視及管理服務。此外,您還可以使用 Microsoft PowerShell 管理服務。SharePoint Server includes services that reside on individual servers in the farm. In some cases, you can configure global service settings and start or stop a service. Services are managed directly in the SharePoint Central Administration website instead of through a separate administration site. You can also remotely monitor and manage services. Additionally, you can manage services by using Microsoft PowerShell.

啟動或停止服務Starting or stopping a service

您可以使用管理中心或 PowerShell 管理服務。You can manage services by using Central Administration or by using PowerShell.

使用管理中心啟動或停止服務To start or stop a service by using Central Administration

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

  2. 在管理中心首頁上,按一下 [系統設定]*On the Central Administration Home page, click *System Settings.

  3. 在 [系統設定] 頁面上,按一下 [伺服器]**** 區段中的 [管理伺服器上的服務]*On the System Settings page, in the *Servers section, click Manage services on server.

  4. 若要變更要啟動或停止服務的伺服器,請在 [伺服器] 功能表上,按一下 [變更伺服器],然後按一下您要的伺服器名稱。To change the server on which you want to start or stop the service, on the Server menu, click Change Server, and then click the server name that you want.

  5. 根據預設,僅會顯示可設定的服務。若要檢視所有服務,請在 [檢視]**** 功能表中,按一下 [全部]*By default, only configurable services are displayed. To view all services, on the *View menu, click All.

  6. 若要啟動或停止服務,按一下相關服務 [動作]**** 欄中的 [重新啟動]**** 或 [停止]*To start or stop a service, click *Restart or Stop in the Action column of the relevant service.

  7. 按一下 [確定]**** 啟動或停止服務。Click OK to start or stop the service.

    使用 Microsoft PowerShell 啟動服務To start a service by using Microsoft PowerShell

  8. 確認您具備下列成員身分: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 授與使用 SharePoint Server Cmdlet 的權限。An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint Server cmdlets.

      注意

      如果您不具備上述權限,請連絡安裝程式系統管理員或 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.

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

  10. 在 PowerShell 命令提示字元中,輸入下列命令:At the PowerShell command prompt, type the following command:

    Start-SPServiceInstance -Identity <ServiceGUID>
    

    其中, <ServiceGUID> 是服務的 GUID。如果不知道服務 GUID,可以使用 Get-SPServiceInstance Cmdlet 檢索伺服器陣列中所有服務的清單以及適當的 GUID。Where <ServiceGUID> is the GUID of the service. If you do not know the service GUID, you can retrieve a list of all services in the farm together with their GUIDs by using the Get-SPServiceInstance cmdlet.

如需詳細資訊,請參閱Start-SPServiceInstanceFor more information, see Start-SPServiceInstance.

使用 PowerShell 停止服務To stop a service by using PowerShell

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

  2. 在 PowerShell 命令提示字元中,輸入下列命令:At the PowerShell command prompt, type the following command:

    Stop-SPServiceInstance -Identity <ServiceGUID>
    

    其中, <ServiceGUID> 是服務的 GUID。如果不知道服務 GUID,可以使用 Get-SPServiceInstance Cmdlet 檢索伺服器陣列中所有服務的清單以及適當的 GUID。Where <ServiceGUID> is the GUID of the service. If you do not know the service GUID, you can retrieve a list of all services in the farm together with their GUIDs by using the Get-SPServiceInstance cmdlet.

如需詳細資訊,請參閱 Stop-SPServiceInstance。建議您在執行命令列管理工作時使用 Windows PowerShell。Stsadm 命令列工具已過時,但為與舊版產品相容,仍會隨附提供。For more information, see Stop-SPServiceInstance. 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.

請參閱See also

概念Concepts

SharePoint Server 的作業Administration of SharePoint Server

其他資源Other Resources

Get-SPServiceInstanceGet-SPServiceInstance