

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

# 使用 檢視組織單位 (OU) 的詳細資訊 AWS Organizations
<a name="orgs_view_ou"></a>

在 [AWS Organizations 主控台](https://console.aws.amazon.com/organizations/v2)登入組織的管理帳戶時，您可以檢視組織中 OU 的詳細資訊。

**最低許可**  
若要檢視組織單位 (OU) 的詳細資訊，您必須擁有以下許可：  
`organizations:DescribeOrganizationalUnit`
`organizations:DescribeOrganization` – 僅在使用 Organizations 主控台時才需要
`organizations:ListOrganizationsUnitsForParent` – 僅在使用 Organizations 主控台時才需要
`organizations:ListRoots` – 僅在使用 Organizations 主控台時才需要

------
#### [ AWS 管理主控台 ]<a name="view_details_ou_v2"></a>

**檢視 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 (而非選項按鈕) 名稱。如果您所需的 OU 是另一個 OU 的子項，選擇其父項 OU 旁邊的三角形圖示以將其展開，並查看階層下一級中的那些項目。重複此操作，直至您找到所需的 OU。

   **Organizational unit details** (組織單位詳細資訊) 方塊會顯示 OU 的相關資訊。

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

**檢視 OU 的詳細資訊**  
您可以使用下列命令來檢視 OU 的詳細資訊：
+ AWS CLI， AWS SDKs 
  + [list-roots](https://docs.aws.amazon.com/cli/latest/reference/organizations/list-roots.html) 
  + [list-children](https://docs.aws.amazon.com/cli/latest/reference/organizations/list-children.html) 
  + [describe-organizational-unit](https://docs.aws.amazon.com/cli/latest/reference/organizations/describe-organizational-unit.html) 

  以下範例顯示如何使用 AWS CLI來尋找 OU 的 ID。您可以透過從 `list-roots` 命令開始周遊階層，然後在根上執行 `list-children` 並對其每個子項反覆執行，來尋找 OU ID，直至找到您所需的一個。

  ```
  $ aws organizations list-roots
  {
      "Roots": [
          {
              "Id": "r-a1b2",
              "Arn": "arn:aws:organizations::123456789012:root/o-aa111bb222/r-a1b2",
              "Name": "Root",
              "PolicyTypes": []
          }
      ]
  }
  $ aws organizations list-children --parent-id r-a1b2 --child-type ORGANIZATIONAL_UNIT
  {
      "Children": [
          {
              "Id": "ou-a1b2-f6g7h111",
              "Type": "ORGANIZATIONAL_UNIT"
          }
      ]
  }
  ```

  取得 OU ID 之後，下列範例顯示如何擷取 OU 的詳細資訊。

  ```
  $ aws organizations describe-organizational-unit --organizational-unit-id ou-a1b2-f6g7h111
  {
      "OrganizationalUnit": {
          "Id": "ou-a1b2-f6g7h111",
          "Arn": "arn:aws:organizations::123456789012:ou/o-aa111bb222/ou-a1b2-f6g7h111",
          "Name": "Production-Apps",
          "Path": "o-aa111bb222/r-a1b2/ou-a1b2-f6g7h111/"
      }
  }
  ```
+ AWS SDKs：
  +  [ListRoots](https://docs.aws.amazon.com/organizations/latest/APIReference/API_ListRoots.html)
  +  [ListChildren](https://docs.aws.amazon.com/organizations/latest/APIReference/API_ListChildren.html)
  +  [DescribeOrganizationalUnit](https://docs.aws.amazon.com/organizations/latest/APIReference/API_DescribeOrganizationalUnit.html)

------