

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

# 從行為圖表移除成員帳戶
<a name="accounts-invited-remove"></a>

管理員帳戶可以隨時從行為圖表中移除受邀的成員帳戶。

Detective 會自動移除終止於 的成員帳戶 AWS，但 AWS GovCloud （美國東部） 和 AWS GovCloud （美國西部） 區域除外。

從行為圖表中移除受邀成員帳戶時，會發生以下情況。
+ 成員帳戶已從**我的成員帳戶**中移除。
+ Amazon Detective 停止從已移除的帳戶擷取資料。

Detective 不會從行為圖表中移除任何現有資料，而此類資料會跨成員帳戶彙總資料。

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

您可以使用 AWS 管理主控台 從行為圖表中移除受邀的成員帳戶。

**若要移除成員帳戶 (主控台)**

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

1. 在 Detective 導覽窗格中，選擇**帳戶管理**。

1. 在帳戶清單中，選取要移除成員帳戶的核取方塊。

   您無法從清單中移除自己的帳戶。

1. 選擇**動作**。然後選擇**停用帳戶**。

------
#### [ Detective API/CLI  ]

您可以使用 Detective API 或 AWS Command Line Interface 從行為圖表中移除受邀的成員帳戶。若要取得行為圖表的 ARN 以供在請求中使用，請使用 [https://docs.aws.amazon.com/detective/latest/APIReference/API_ListGraphs.html](https://docs.aws.amazon.com/detective/latest/APIReference/API_ListGraphs.html) 操作。

**從行為圖表中移除受邀的成員帳戶 (Detective API) AWS CLI**
+ **Detective API：**使用 [https://docs.aws.amazon.com/detective/latest/APIReference/API_DeleteMembers.html](https://docs.aws.amazon.com/detective/latest/APIReference/API_DeleteMembers.html) 操作。指定圖表 ARN 和要移除成員帳戶的帳戶識別符清單。
+ **AWS CLI：**在命令列中執行 [https://docs.aws.amazon.com/cli/latest/reference/detective/delete-members.html](https://docs.aws.amazon.com/cli/latest/reference/detective/delete-members.html) 命令。

  ```
  aws detective delete-members --account-ids {{<account ID list>}} --graph-arn {{<behavior graph ARN>}}
  ```

  範例：

  ```
  aws detective delete-members --account-ids 444455556666 123456789012 --graph-arn arn:aws:detective:us-east-1:111122223333:graph:123412341234
  ```

------
#### [ Python script ]

Detective 在 GitHub 中提供了開放原始指令碼。您可以是該指令碼，將指定的成員帳戶清單從跨區域特定清單的管理員帳戶行為圖表中移除。

如需如何設定和使用 GitHub 指令碼的相關資訊，請參閱 [使用 Detective Python 指令碼來管理帳戶](detective-github-scripts.md)。

------