

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 删除 Detective 管理员账号
<a name="accounts-remove-admin-overview"></a>

组织管理账户可以删除区域中当前的 Detective 管理员账户。删除 Detective 管理员账户时，Detective 只会将其从当前区域中删除。它不会更改 Organizations 中的委托管理员账户。

当组织管理账户删除某个区域中的 Detective 管理员账户时，Detective 会删除组织行为图。已删除的 Detective 管理员账户已禁用 Detective。

要删除 Detective 当前的委托管理员账户，需要使用 Organizations API。删除 Detective in Organizations 委托管理员账户后，Detective 会删除所有委托管理员账户为 Detective 管理员账户的组织行为图。使用组织管理账户作为 Detective 管理员账户的组织行为图不会受到影响。

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

可以从 Detective 控制台删除 Detective 管理员账户。

删除 Detective 管理员账户后，将对该账户禁用 Detective，并删除组织行为图。仅在当前区域中删除 Detective 管理员账户。

**重要**  
删除 Detective 管理员账户不会影响 Organizations 中的委托管理员账户。

**要删除 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 管理员账户不会影响 Organizations 中的委托管理员账户。

**要移除 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 管理员账户不会自动删除 Organizations 中的授权管理员账户。要删除 Detective 的授权管理员账户，可以使用 Organizations API。

删除授权管理员账户时，这会删除授权管理员账户为 Detective 管理员账户的所有组织行为图。它还会禁用这些区域中账户的 Detective 功能。

**移除委派的管理员账号（Organizations API， AWS CLI）**
+ **Organizations 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
  ```