

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

# 通过以下方式查看组织单位 (OU) 的详细信息 AWS Organizations
<a name="orgs_view_ou"></a>

当您在[AWS Organizations 控制台](https://console.aws.amazon.com/organizations/v2)中登录组织的管理账户时，可以查看组织 OUs 中的详细信息。

**最小权限**  
要查看组织单元 (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，并查看层次结构的下一级。重复操作，直到找到所需的 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)

------