

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

# 使用 將帳戶移至組織單位 (OU) 或根帳戶和 OUs 之間 AWS Organizations
<a name="move_account_to_ou"></a>

登入到您的組織的管理帳戶時，您可以將您的組織中的帳戶從根移至 OU，在 OU 間移動，或從 OU 回到根。將帳戶放置在 OU 內，可讓它受限於連接至父 OU 和父系鏈結中任何 OU 的任何政策。如果帳戶不在 OU 中，則僅受限於直接連接至根政策，以及直接連接帳戶的任何政策。若要移動帳戶，請完成以下步驟。

**最低許可**  
若要將帳戶移至 OU 階層中的新位置，您必須擁有以下許可：  
`organizations:DescribeOrganization` – 僅在使用 Organizations 主控台時才需要
`organizations:MoveAccount`

------
#### [ AWS 管理主控台 ]

**將帳戶移至 OU**

1. 登入 [AWS Organizations 主控台](https://console.aws.amazon.com/organizations/v2)。您必須以 IAM 使用者登入、擔任 IAM 角色，或是以組織管理帳戶中的根使用者 ([不建議](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials)) 身分登入。

1. 在 **[AWS 帳戶](https://console.aws.amazon.com/organizations/v2/home/accounts)** 頁面上，尋找您要移動的一個或多個帳戶。您可以導覽 OU 階層，或啟用**僅檢視 AWS 帳戶 **，以查看沒有 OU 結構的帳戶平面清單。如果您有許多帳戶，您可能需要在清單底部選擇**載入更多採用 '*ou-name*' 的帳戶**，以尋找您想要移動的所有內容。

1. 選擇您要移動的每個帳戶名稱旁邊的核取方塊 ![Blue checkmark icon indicating confirmation or completion of a task.](http://docs.aws.amazon.com/zh_tw/organizations/latest/userguide/images/checkbox-selected.png)。

1. 在 **Actions** (動作) 選單的 **AWS 帳戶** 下，選擇 **Move** (移動)。

1. 在 **Move AWS 帳戶** (啟動 AWS 帳戶帳戶)對話方塊中，導覽至至您要移動帳戶的目標 OU 或根並選擇，然後選擇 **Move AWS 帳戶(移動 AWS 帳戶帳戶)**。

------
#### [ AWS CLI & AWS SDKs ]

**將帳戶移至 OU**  
您可以使用下列其中一項命令來移動帳戶：
+ AWS CLI: [move-account](https://docs.aws.amazon.com/cli/latest/reference/organizations/move-account.html)

  下列範例會將 AWS 帳戶 從根目錄移至 OU。請注意，您必須指定來源和目的地容器的 ID。

  ```
  $ aws organizations move-account \
      --account-id 111122223333 \
      --source-parent-id r-a1b2 \
      --destination-parent-id ou-a1b2-f6g7h111
  ```

  此命令成功後就不會產生輸出。
+ AWS SDKs：[MoveAccount](https://docs.aws.amazon.com/organizations/latest/APIReference/API_MoveAccount.html)

------