共用方式為


在 SharePoint Server 中指派或移除服務應用程式的系統管理員

適用於:yes-img-132013 yes-img-162016 yes-img-192019 yes-img-se訂閱版 no-img-sopMicrosoft 365 中的 SharePoint

SharePoint Server 服務應用程式的系統管理員必須是伺服器陣列系統管理員群組的成員,才能將其他系統管理員指派或移除至該服務應用程式。 服務應用程式管理員會被授與 SharePoint 管理中心網站的安全性調整存取權,而且可以管理與服務應用程式相關的設定,但必須是伺服器陣列管理員群組的成員,才能新增和移除其他服務應用程式管理員。

注意事項

根據預設,伺服器陣列管理員群組的成員具有管理所有服務應用程式的權限。

您可以使用 SharePoint 管理中心網站或使用 Microsoft PowerShell 來指派或移除服務應用程式系統管理員。

使用管理中心指派或移除服務應用程式的管理員

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

  2. On the Central Administration Home page, in the Application Management section, click Manage service applications.

  3. 在 [管理服務應用程式] 頁面上,選取包含您要新增或移除管理員的服務應用程式的列。 功能區隨即變為可用。

  4. 在功能區上,按一下 [管理員]

  5. 新增管理員:

    • In the first text box on the page, type the user accounts or groups that you want to add. You can click the People icon to validate a name. You can click the Address book icon to search for users to add. You can add multiple administrators into the text box.
    • After you have added the administrators, click OK.
  6. 若要移除管理員:

    • 在頁面的第二個文字方塊中,選取您要刪除的管理員。 此步驟不會從系統中移除使用者,只會撤銷使用者對所選服務應用程式的管理權限。
    • 按一下移除
    • After you have finished removing administrators, click OK.

使用 PowerShell 指派或移除服務應用程式管理員

  1. 確認您是否符合下列基本需求:

    • 您必須具備 SQL Server 執行個體之 securityadmin 固定伺服器角色中的成員資格。

    • 您必須具備所有待更新資料庫之 db_owner 固定資料庫角色中的成員資格。

    • 您必須是正在執行 PowerShell Cmdlet 之伺服器上的系統管理員群組成員。

    注意事項

    如果未符合這些權限,請連絡設定系統管理員或 SQL Server 系統管理員以要求這些權限。

    如需 PowerShell 許可權的詳細資訊,請參閱 許可權Add-SPShellAdmin

  2. 啟動 SharePoint 管理命令介面。

  3. 若要建立宣告主體,請在 PowerShell 命令提示字元處,輸入下列命令:

    $principal = New-SPClaimsPrincipal "<contoso\jane>" -IdentityType WindowsSamAccountName
    

    其中 contoso\jane 是您要指派系統管理權限的使用者名稱。 使用者名稱應該以 或 contoso\jane 的形式jane@contoso.com輸入。 新的宣告主體儲存在 $principal 變數。

  4. 若要擷取服務應用程式,請輸入下列命令:

    $spapp = Get-SPServiceApplication -Name "<ServiceApplicationDisplayName>"
    

    其中 ServiceApplicationDisplayName 是服務應用程式的顯示名稱。 服務應用程式身分識別儲存在 $spapp 變數。

    重要事項

    顯示名稱必須以引號括住,而且它必須完全符合服務應用程式顯示名稱。 這包括大小寫。 如果您有多個具有相同顯示名稱的服務應用程式 (我們不建議使用此) ,您可以使用 Get-SPServiceApplication Cmdlet 來檢視所有服務應用程式。 接著您可以依 GUID 來識別服務應用程式。 如需詳細資訊,請參閱 Get-SPServiceApplication

  5. 若要擷取服務應用程式的管理員安全性物件,請輸入下列命令:

    $security = Get-SPServiceApplicationSecurity $spapp -Admin
    

    擷取的管理員安全性物件儲存在 $security 變數。

    注意

    使用此命令時,請務必附加 -管理員引數。

  6. 若要指派或撤銷以新宣告主體 $principal (在本程序第 6 步建立) 識別之使用者的管理權限,給服務應用程式管理員安全性物件 $security (在本程序第 8 步取得),請使用適當的命令,如下例所示:

    • 若要指派管理權限,請輸入下列命令:

      Grant-SPObjectSecurity $security $principal "Full Control"
      
      
    • 若要撤銷管理權限,請輸入下列命令:

      Revoke-SPObjectSecurity $security $principal
      
  7. 若要指派更新的 $security 安全性物件給服務應用程式,請輸入下列命令:

    Set-SPServiceApplicationSecurity $spapp $security -Admin
    

    注意

    使用此命令時,請務必附加 -管理員引數。

  8. 若要確認服務應用程式的安全性物件經過適當地更新,請輸入下列命令:

    (Get-SPServiceApplicationSecurity $spapp -Admin).AccessRules
    

範例

在下列範例中,服務帳戶使用者 "contoso\jane" 已新增至名稱為 "Contoso Visio Graphics" 的服務應用程式管理安全性物件中。

$principal = New-SPClaimsPrincipal "contoso\jane" -IdentityType WindowsSamAccountName
$spapp = Get-SPServiceApplication -Name "Contoso Visio Graphics"
$security = Get-SPServiceApplicationSecurity $spapp -Admin
Grant-SPObjectSecurity $security $principal "Full Control"
Set-SPServiceApplicationSecurity $spapp $security -Admin
(Get-SPServiceApplicationSecurity $spapp -Admin).AccessRules

在下列範例中,服務帳戶使用者 "contoso\jane" 已從名稱為 "Contoso Visio Graphics" 服務應用程式管理安全性物件中移除。

$principal = New-SPClaimsPrincipal "contoso\jane" -IdentityType WindowsSamAccountName
$spapp = Get-SPServiceApplication -Name "Contoso Visio Graphics"
$security = Get-SPServiceApplicationSecurity $spapp -Admin
Revoke-SPObjectSecurity $security $principal "Full Control"
Set-SPServiceApplicationSecurity $spapp $security -Admin
(Get-SPServiceApplicationSecurity $spapp -Admin).AccessRules

如需詳細資訊,請參閱下列 Microsoft PowerShell 文章。

注意事項

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