

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 移除 Detective 管理員帳戶
<a name="accounts-remove-admin-overview"></a>

組織管理帳戶可以移除區域中目前的 Detective 管理員帳戶。當您移除 Detective 管理員帳戶時，Detective 只會將其從目前的區域中移除。它不會變更組織中的委派管理員帳戶。

當組織管理帳戶移除區域中的 Detective 管理員帳戶時，Detective 會刪除組織行為圖表。已移除的 Detective 管理員帳戶將停用 Detective。

若要移除 Detective 目前委派的管理員帳戶，您可以使用組織 API。當您移除組織中 Detective 的委派管理員帳戶時，Detective 會刪除所有組織行為圖表，其中委派的管理員帳戶是 Detective 管理員帳戶。將組織管理帳戶作為 Detective 管理員帳戶的組織行為圖表不會受到影響。

------
#### [ Console ]

您可以從 Detective 主控台移除 Detective 管理員帳戶。

當您移除 Detective 管理員帳戶時，系統會停用該帳戶的 Detective，並且會刪除組織行為圖表。Detective 管理員帳戶僅會在目前區域中移除。

**重要**  
移除 Detective 管理員帳戶不會影響組織中委派的管理員帳戶。

**若要移除 Detective 管理員帳戶 (**啟用 Detective** 頁面)**

1. 前往 [https://console.aws.amazon.com/detective/](https://console.aws.amazon.com/detective/) 開啟 Amazon Detective 主控台。

1. 選擇**開始使用**。

1. 在**委派的管理員**下，選擇**停用 Amazon Detective**。

1. 在確認對話方塊上，輸入 **disable**，然後選擇**停用 Amazon Detective**。

**若要移除 Detective 管理員帳戶 (**一般**頁面)**

1. 前往 [https://console.aws.amazon.com/detective/](https://console.aws.amazon.com/detective/) 開啟 Amazon Detective 主控台。

1. 在 Detective 導覽窗格中，於**設定**下選擇**通用**。

1. 在**委派的管理員**下，選擇**停用 Amazon Detective**。

1. 在確認對話方塊上，輸入 **disable**，然後選擇**停用 Amazon Detective**。

------
#### [ Detective API, AWS CLI ]

若要移除 Detective 管理員帳戶，您可以使用 API 呼叫或 AWS CLI。您必須使用組織的管理帳戶憑證。

當您移除 Detective 管理員帳戶時，系統會停用該帳戶的 Detective，並且會刪除組織行為圖表。

**重要**  
移除 Detective 管理員帳戶不會影響組織中委派的管理員帳戶。

**若要移除 Detective 管理員帳戶 (Detective API) AWS CLI**
+ **Detective API：**使用 [https://docs.aws.amazon.com/detective/latest/APIReference/API_DisableOrganizationAdminAccount.html](https://docs.aws.amazon.com/detective/latest/APIReference/API_DisableOrganizationAdminAccount.html) 操作。

  當您使用 Detective API 移除 Detective 管理員帳戶時，只會在發出 API 呼叫或指令的區域中移除該帳戶。
+ **AWS CLI：**在命令列中執行 [https://docs.aws.amazon.com/cli/latest/reference/detective/disable-organization-admin-account.html](https://docs.aws.amazon.com/cli/latest/reference/detective/disable-organization-admin-account.html) 命令。

  ```
  aws detective disable-organization-admin-account
  ```

------

## 移除委派管理員帳戶
<a name="accounts-remove-admin-orgs-api"></a>

移除 Detective 管理員帳戶並不會自動移除組織中委派的管理員帳戶。若要移除 Detective 的委派管理員帳戶，您可以使用組織 API。

當您移除委派的管理員帳戶時，這會刪除委派管理員帳戶為 Detective 管理員帳戶的所有組織行為圖表。此舉還會停用此類區域中帳戶的 Detective。

**若要移除委派管理員帳戶 (Organizations API) AWS CLI**
+ **組織 API：**使用 [https://docs.aws.amazon.com/organizations/latest/APIReference/API_DeregisterDelegatedAdministrator.html](https://docs.aws.amazon.com/organizations/latest/APIReference/API_DeregisterDelegatedAdministrator.html) 操作。您必須提供 Detective 管理員帳戶的帳戶識別符，以及 Detective 的服務主體，即 `detective.amazonaws.com`。
+ **AWS CLI：**在命令列中執行 [https://docs.aws.amazon.com/cli/latest/reference/organizations/deregister-delegated-administrator.html](https://docs.aws.amazon.com/cli/latest/reference/organizations/deregister-delegated-administrator.html) 命令。

  ```
  aws organizations deregister-delegated-administrator --account-id {{<Detective administrator account ID>}} --service-principal {{<Detective service principal>}}
  ```

  **範例**

  ```
  aws organizations deregister-delegated-administrator --account-id 777788889999 --service-principal detective.amazonaws.com
  ```