Share via


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

適用于:yes-img-132013 yes-img-16 2016yes-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. 若要移除管理員:

    • 在頁面的第二個文字方塊中,選取您要刪除的管理員。 請注意,該步驟不會移除系統中的使用者,其只會撤銷使用者對於選取服務應用程式的管理權限。
    • Click Remove.
    • 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 是您要指派系統管理許可權的使用者名稱。 使用者名稱的輸入格式應為 jane@contoso.com 或 contoso\jane。 新的宣告主體儲存在 $principal 變數。

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

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

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

    重要事項

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

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

    $security = Get-SPServiceApplicationSecurity $spapp -Admin
    

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

    注意

    [!注意] 使用此命令時請務必附加 -Admin 引數。

  6. 若要將新宣告主體所識別的使用者指派或撤銷系統管理許可權 ,$principal (在此程式的步驟 6 中建立,) 服務應用程式系統管理員安全性物件 $security) 步驟 8 中取得 (,請使用適當的命令,如下列範例所示:

    • 若要指派管理權限,請輸入下列命令:
    Grant-SPObjectSecurity $security $principal "Full Control"
    
    
    • 若要撤銷管理權限,請輸入下列命令:
    Revoke-SPObjectSecurity $security $principal
    
  7. 若要指派更新的 $security 安全性物件給服務應用程式,請輸入下列命令:

    Set-SPServiceApplicationSecurity $spapp $security -Admin
    

    注意

    [!注意] 使用此命令時請務必附加 -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 命令列工具已過時,但為與舊版產品相容,仍會隨附提供。