

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# Active Directory サービスアカウントをプロビジョニングする
<a name="provision-service-account"></a>

Amazon FSx for NetApp ONTAP SVM をオンプレミスの Active Directory ドメインに結合する場合は、Amazon FSx ファイルシステムが存続する間、有効な Active Directory サービスアカウントを維持する必要があります。Amazon FSx は、ファイルシステムをフルマネージし、障害が発生したファイル SVM の置き換えや NetApp ONTAP ソフトウェアへのパッチ適用など、Active Directory ドメインの結合解除と再結合を必要とするタスクを実行できる必要があります。サービスアカウントの認証情報を含む Active Directory の設定を Amazon FSx で定期的に更新してください。

このサービスアカウントには、Active Directory の次のアクセス許可が必要です。
+ コンピュータをドメインに結合するアクセス許可
+ ファイルシステムを結合している組織単位 (OU) では、次のアクセス許可が必要です。
  + パスワードのリセット
  + アカウントのデータの読み取りと書き込みを制限する
  + DNS ホスト名への書き込み
  + サービスプリンシパル名への書き込み
  + コンピュータオブジェクトを作成および削除する
  + アカウントの読み取りおよび書き込み制限

Active Directory ドメイン管理者は **Active Directory ユーザーとコンピュータ**の MMC スナップインを使用して、サービスアカウントを手動で作成できます。手順については、「FSx for ONTAP ドキュメント」で「[Amazon FSx サービスアカウントにアクセス許可を委任する](https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/self-managed-AD-best-practices.html#connect_delegate_privileges)」を参照してください。このアカウントはプログラムで設定することもできます。例えば、次の例に示すとおり、[PowerShell](https://learn.microsoft.com/en-us/powershell/) を使用できます。

```
param(
    [string] $DomainName,
    [string] $Username, #Service Account username
    [string] $Firstname, #Service Account Firstname
    [string] $Lastname, #Service Account Lastname
    [string] $saOU, #OU where Service Account is created
    [string] $delegateOrganizationalUnit #OU where Service Account has delegation
)

#Retrieve Active Directory domain credentials of a Domain Admin
$DomainCredential = ...

#Import Active Directory PowerShell module
...

#Create Service Account in specified OU
New-Active DirectoryUser -Credential $DomainCredential -SamAccountName $Username -UserPrincipalName "$Username@$DomainName" -Name "$Firstname $Lastname" -GivenName $Firstname -Surname $Lastname -Enabled $True -ChangePasswordAtLogon $False -DisplayName "$Lastname, $Firstname" -Path $saOU -CannotChangePassword $True -PasswordNotRequired $True
$user = Get-Active Directoryuser -Identity $Username
$userSID = [System.Security.Principal.SecurityIdentifier] $user.SID

#Connect to Active Directory drive
Set-Location Active Directory:

$ACL = Get-Acl -Path $delegateOrganizationalUnit
$Identity = [System.Security.Principal.IdentityReference] $userSID

#GUID of Active Directory Class
$Computers = [GUID]"bf967a86-0de6-11d0-a285-00aa003049e2"
$ResetPassword = [GUID]"00299570-246d-11d0-a768-00aa006e0529"
$ValidatedDNSHostName = [GUID]"72e39547-7b18-11d1-adef-00c04fd8d5cd"
$ValidatedSPN = [GUID]"f3a64788-5306-11d1-a9c5-0000f80367c1"
$AccountRestrictions = [GUID]"4c164200-20c0-11d0-a768-00aa006e0529"

#Delegation list
$rules = @()
$rules += $(New-Object System.DirectoryServices.ActiveDirectoryAccessRule($Identity, "CreateChild, DeleteChild", "Allow", $Computers, "All"))
$rules += $(New-Object System.DirectoryServices.ActiveDirectoryAccessRule($Identity, "ExtendedRight", "Allow", $ResetPassword, "Descendents", $Computers))
$rules += $(New-Object System.DirectoryServices.ActiveDirectoryAccessRule($Identity, "ReadProperty, WriteProperty", "Allow", $AccountRestrictions, "Descendents", $Computers))
$rules += $(New-Object System.DirectoryServices.ActiveDirectoryAccessRule($userSID, "Self", "Allow", $ValidatedDNSHostName, "Descendents", $Computers))
$rules += $(New-Object System.DirectoryServices.ActiveDirectoryAccessRule($userSID, "Self", "Allow", $ValidatedSPN, "Descendents", $Computers))

#Set delegation
foreach($rule in $rules) {
    $ACL.AddAccessRule($rule)
}
Set-Acl -Path $delegateOrganizationalUnit -AclObject $ACL
```