AWS Directory Service
管理指南 (版本 1.0)
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

步骤 4:测试将适用于 Windows Server 的 EC2 实例无缝加入到域中

您可以使用以下两种方法之一来测试无缝域加入。

方法 1:使用 Amazon EC2 控制台测试域加入

在目录使用者账户中使用此步骤。

  1. 登录 AWS 管理控制台并通过以下网址打开 Amazon EC2 控制台 https://console.amazonaws.cn/ec2/

  2. From the region selector in the navigation bar, choose the same region as the existing directory.

  3. Choose Launch Instance.

  4. On the Step 1 page, choose Select for the appropriate AMI.

  5. On the Step 2 page, select the appropriate instance type, and then choose Next: Configure Instance Details.

  6. On the Step 3 page, do the following, and then choose Next: Add Storage:

    1. For Network, choose the VPC that your directory was created in.

    2. For Subnet, choose one of the public subnets in your VPC. The subnet that you choose must have all external traffic routed to an internet gateway. If this is not the case, you won't be able to connect to the instance remotely.

    3. For Auto-assign Public IP, choose Enable.

      For more information about public and private IP addressing, see Amazon EC2 Instance IP Addressing in the Amazon EC2 用户指南(适用于 Windows 实例).

    4. For Domain join directory, choose your domain from the list.

      注意

      This option is only available for Windows instances. Linux instances must be manually joined to the directory as explained in 手动加入 Linux 实例.

    5. For IAM role, do one of the following:

      Select an IAM role that has the AWS managed policies AmazonSSMManagedInstanceCore and AmazonSSMDirectoryServiceAccess attached to it.

      -or-

      If you haven't created an IAM role that has the AmazonSSMManagedInstanceCore and AmazonSSMDirectoryServiceAccess managed policies attached to it, choose the Create new IAM role link, and then do the following:

      1. Choose Create role.

      2. Under Select type of trusted entity, choose AWS service.

      3. Under Choose the service that this role will use, in the full list of services, choose EC2 .

      4. Under Select your use case, choose EC2, and the choose Next: Permissions.

      5. In the list of policies, select the AmazonSSMManagedInstanceCore and AmazonSSMDirectoryServiceAccess policies. (To filter the list, type SSM in the search box.)

        注意

        AmazonSSMDirectoryServiceAccess provides the permissions to join instances to an Active Directory managed by AWS Directory Service. AmazonSSMManagedInstanceCore provides the minimum permissions necessary to use the Systems Manager service. For more information about creating a role with these permissions, and for information about other permissions and policies you can assign to your IAM role, see Create an IAM Instance Profile for Systems Manager in the AWS Systems Manager 用户指南.

      6. Choose Next: Tags.

      7. (Optional) Add one or more tag key-value pairs to organize, track, or control access for this role, and then choose Next: Review.

      8. For Role name, enter a name for your new role, such as EC2DomainJoin or another name that you prefer.

      9. (Optional) For Role description, enter a description.

      10. Choose Create role.

      11. Go back to the Step 3 page. For IAM role, choose the refresh icon next to IAM role. Your new role should be visible in the menu. Choose it and leave the rest of the settings on this page with their default values, and then choose Next: Add Storage.

  7. On both the Step 4 and Step 5 pages, leave the default settings or make changes as needed, and then choose the Next buttons.

  8. On the Step 6 page, select a security group for the instance that has been configured to allow remote access to the instance from your network, and then choose Review and Launch.

  9. On the Step 7 page, choose Launch, select a key pair, and then choose Launch Instance.

方法 2:使用 AWS Systems Manager 控制台测试域加入

在目录使用者账户中使用此步骤。要完成此过程,您需要有关目录所有者账户的一些信息。

注意

确保首先针对您的实例将 AmazonSSMManagedInstanceCoreAmazonSSMDirectoryServiceAccess 托管策略附加到 IAM 角色权限,然后再启动此过程中的步骤。对于 Systems Manager,有关您可附加到 IAM 实例配置文件的这些托管策略及其他策略的信息,请参阅 AWS Systems Manager 用户指南 中的为 Systems Manager 创建 IAM 实例配置文件。有关托管策略的信息,请参阅 IAM 用户指南 中的 AWS 托管策略

  1. 登录 AWS 管理控制台 并通过以下网址打开 AWS Systems Manager 控制台:https://console.aws.amazon.com/systems-manager/

  2. 在导航窗格中,选择 Run Command

  3. 选择运行命令

  4. Run a command (运行命令) 页面上,搜索 AWS-JoinDirectoryServiceDomain。当它显示在搜索结果中时,选择 AWS-JoinDirectoryServiceDomain 选项。

  5. 向下滚动到 Command parameters (命令参数) 部分。您必须提供以下参数:

    • 对于 Directory Id (目录 ID),输入 AWS Directory Service 目录的名称。

      注意

      您可以通过返回 AWS Directory Service 控制台,选择 Directories shared with me (与我共享的目录),选择您的目录,然后在 Shared directory details (共享目录详细信息) 部分中查找值,从而找到 Directory Id (目录 ID) 值。

    • 对于 Directory Name (目录名称),输入目录的名称(对于目录所有者账户)。

    • 对于 DNS IP Addresses (DNS IP 地址),输入目录中 DNS 服务器的 IP 地址(对于目录所有者账户)。

    注意

    您可以通过返回 AWS Directory Service 控制台,选择 Directories shared with me (与我共享的目录),选择您的目录,然后查看在 Owner directory details (所有者目录详细信息) 中找到的属性,从而找到 Directory Name (目录名称)Dns Ip Addresses (DNS IP 地址) 的值。

  6. 对于 Targets (目标),选择您希望加入域的实例。

  7. 保留窗体的剩余部分设置为其默认值,向下滚动页面,然后选择 Run (运行)

  8. 在导航窗格中,选择托管实例

  9. 通过查看列表中的实例来确认成功加入域的实例。如果 Association Status (关联状态) 显示 Success (成功),则您的实例已成功加入域。

完成任一过程的步骤之后,您现在应该能够将您的 EC2 实例加入域。完成此操作后,您可以通过远程桌面协议 (RDP) 客户端使用 AWS Managed Microsoft AD 用户账户中的凭证登录您的实例。