验证 Active Directory 配置 - FSx适用于 Windows 文件服务器的亚马逊

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

验证 Active Directory 配置

在创建加入活动目录FSx的 Windows 文件服务器文件系统之前,我们建议您使用亚马逊 Active Directory 验证工具验证您的FSx活动目录配置。请注意,成功验证 Active Directory 配置需要出站互联网连接。

验证 Active Directory 配置
  1. 在与 EC2 Windows 文件服务器文件系统相同的子网和相同亚马逊VPC安全组中启动一个 Amazon Windows 实例。FSx确保您的EC2实例具有所需的AmazonEC2ReadOnlyAccessIAM权限。您可以使用IAM策略模拟器验证EC2实例角色权限。有关更多信息,请参阅IAM用户指南中的使用IAMIAM策略模拟器测试策略。

  2. 将你的 EC2 Windows 实例加入你的活动目录。有关更多信息,请参阅《AWS Directory Service 管理指南》中的手动加入 Windows 实例

  3. Connect 连接到您的EC2实例。有关更多信息,请参阅亚马逊EC2用户指南中的连接到您的 Windows 实例

  4. 在EC2实例上打开 Windows PowerShell 窗口(使用以管理员身份运行)。

    要测试是否安装了 Windows PowerShell 所需的活动目录模块,请使用以下测试命令。

    PS C:\> Import-Module ActiveDirectory

    如果上一操作返回错误,请使用以下命令进行安装。

    PS C:\> Install-WindowsFeature RSAT-AD-PowerShell
  5. 使用以下命令下载网络验证工具。

    PS C:\> Invoke-WebRequest "https://docs.aws.amazon.com/fsx/latest/WindowsGuide/samples/AmazonFSxADValidation.zip" -OutFile "AmazonFSxADValidation.zip"
  6. 使用以下命令下载 zip 文件。

    PS C:\> Expand-Archive -Path "AmazonFSxADValidation.zip"
  7. AmazonFSxADValidation 模块添加到当前会话。

    PS C:\> Import-Module .\AmazonFSxADValidation
  8. 通过替换为以下命令来设置必需的参数:

    • 活动目录域名 (DOMAINNAME.COM)

    • 使用以下选项之一为服务账户密码准备 $Credential 对象。

      • 要以交互方式生成凭证对象,请使用以下命令。

        $Credential = Get-Credential
      • 要使用 AWS Secrets Manager 资源生成凭证对象,请使用以下命令。

        $Secret = ConvertFrom-Json -InputObject (Get-SECSecretValue -SecretId $AdminSecret).SecretString $Credential = (New-Object PSCredential($Secret.UserName,(ConvertTo-SecureString $Secret.Password -AsPlainText -Force)))
    • DNS服务器 IP 地址 (IP_ADDRESS_1, IP_ADDRESS_2)

    • 您计划在其中创建 Amazon FSx 文件系统的子网的子网 ID (SUBNET_1, SUBNET_2,例如,subnet-04431191671ac0d19)。

    PS C:\> $FSxADValidationArgs = @{ # DNS root of ActiveDirectory domain DomainDNSRoot = 'DOMAINNAME.COM' # IP v4 addresses of DNS servers DnsIpAddresses = @('IP_ADDRESS_1', 'IP_ADDRESS_2') # Subnet IDs for Amazon FSx file server(s) SubnetIds = @('SUBNET_1', 'SUBNET_2') Credential = $Credential }
  9. (可选)在运行验证工具之前 DomainControllersMaxCount,按照随附README.md文件中的说明设置组织单位、委派管理员组并启用服务帐户权限验证。

    注意

    如果操作系统非英语,则 Domain Admins 组的名称会有所不同。例如,该组在法语 OS 版本中被命名为 Administrateurs du domaine。如果未指定值,则将使用默认 Domain Admins 组名,且文件系统创建失败。

  10. 使用此命令运行验证工具。

    PS C:\> $Result = Test-FSxADConfiguration @FSxADValidationArgs
  11. 以下是成功测试结果的示例。

    Test 1 - Validate EC2 Subnets ... ... Test 17 - Validate 'Delete Computer Objects' permission ... Test computer object amznfsxtestd53f deleted! ... SUCCESS - All tests passed! Please proceed to creating an Amazon FSx file system. For your convenience, SelfManagedActiveDirectoryConfiguration of result can be used directly in CreateFileSystemWindowsConfiguration for New-FSXFileSystem PS C:\AmazonFSxADValidation> $Result.Failures.Count 0 PS C:\AmazonFSxADValidation> $Result.Warnings.Count 0

    以下是测试结果有误的示例。

    Test 1 - Validate EC2 Subnets ... ... Test 7 - Validate that provided EC2 Subnets belong to a single AD Site ... Name DistinguishedName Site ---- ----------------- ---- 10.0.0.0/19 CN=10.0.0.0/19,CN=Subnets,CN=Sites,CN=Configuration,DC=test-ad,DC=local CN=SiteB,CN=Sites,CN=Configu... 10.0.128.0/19 CN=10.0.128.0/19,CN=Subnets,CN=Sites,CN=Configuration,DC=test-ad,DC=local CN=Default-First-Site-Name,C... 10.0.64.0/19 CN=10.0.64.0/19,CN=Subnets,CN=Sites,CN=Configuration,DC=test-ad,DC=local CN=SiteB,CN=Sites,CN=Configu... Best match for EC2 subnet subnet-092f4caca69e360e7 is AD site CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=te st-ad,DC=local Best match for EC2 subnet subnet-04431191671ac0d19 is AD site CN=SiteB,CN=Sites,CN=Configuration,DC=test-ad,DC=local WARNING: EC2 subnets subnet-092f4caca69e360e7 subnet-04431191671ac0d19 matched to different AD sites! Make sure they are in a single AD site. ... 9 of 16 tests skipped. FAILURE - Tests failed. Please see error details below: Name Value ---- ----- SubnetsInSeparateAdSites {subnet-04431191671ac0d19, subnet-092f4caca69e360e7} Please address all errors and warnings above prior to re-running validation to confirm fix. PS C:\AmazonFSxADValidation> $Result.Failures.Count 1 PS C:\AmazonFSxADValidation> $Result.Failures Name Value ---- ----- SubnetsInSeparateAdSites {subnet-04431191671ac0d19, subnet-092f4caca69e360e7} PS C:\AmazonFSxADValidation> $Result.Warnings.Count 0

    如果您在运行验证工具时收到警告或错误,请参阅验证工具包(TROUBLESHOOTING.md)和 对亚马逊进行故障排除 FSx 中包含的《问题排查指南》。