驗證您的活動目錄配置 - Amazon FSx for Windows File Server

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

驗證您的活動目錄配置

在您建立連接到活動目錄的 Windows 檔案伺服器檔案系統 FSx 之前,我們建議您使用 Amazon FSx 作用中目錄驗證工具來驗證您的作用中目錄組態。請注意,輸出網際網路連線需要成功驗證 Active Directory 組態。

若要驗證您的作用中目錄組態
  1. 在相同的子網路中啟動 Amazon EC2 Windows 執行個體,並使用您用於 Windows 檔案伺服器檔案系統 FSx 的相同 Amazon VPC 安全群組。確保您的 EC2 執行個體具有所需的 AmazonEC2ReadOnlyAccess IAM 許可。您可以使用 IAM 政策模擬器驗證 EC2 執行個體角色許可。如需詳細資訊,請參閱 IAM 使用者指南中的使用 IAM 政策模擬器測試 IAM 政策。

  2. 將您的 EC2 視窗執行個體加入您的活動目錄。如需詳細資訊,請參閱《管理指南》中的〈手動加入 Windows 執行個AWS Directory Service 〉

  3. 連線至 EC2 執行個體。如需詳細資訊,請參閱 Amazon 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. 通過替換以下命令來設置所需的參數:

    • 活動目錄域名(域名 .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 位址 1、IP 位址 2)

    • 您打算在其中建立 Amazon FSx 檔案系統的子網路識別碼 (例如,SU BNET_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群組會有不同的名稱。例如,群組以法文作業系統版本命名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) 和疑難排解 Amazon FSx