AD DS (Active Directory Domain Services) の役割を追加した後、ドメイン コントローラーへの昇格を行います。役割追加に引き続き、PowerShell でやってみることにします。
AD DS の役割追加については、以下のページを参照してください。
Windows Server 2016 で AD DS (Active Directory Domain Services) のセットアップ
新しいフォレストに新しいドメインを作成するためには、Install-ADDSForest コマンドレットを使います。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$password = ConvertTo-SecureString -String <パスワード> -AsPlainText -Force Install-ADDSForest -DomainName "example.local" ` -DomainNetbiosName "EXAMPLE" ` -ForestMode "WinThreshold" ` -DomainMode "WinThreshold" ` -SafeModeAdministratorPassword $password ` -DatabasePath "C:\Windows\NTDS" ` -LogPath "C:\Windows\NTDS" ` -SysvolPath "C:\Windows\SYSVOL" ` -CreateDnsDelegation:$false ` -InstallDns:$true ` -NoRebootOnCompletion:$false ` -Force:$true |
1 行で書く場合は、次のようにできます。
1 |
Install-ADDSForest -DomainName "example.local" -DomainNetbiosName "EXAMPLE" -ForestMode "WinThreshold" -DomainMode "WinThreshold" -SafeModeAdministratorPassword (ConvertTo-SecureString -String <パスワード> -AsPlainText -Force) -DatabasePath "C:\Windows\NTDS" -LogPath "C:\Windows\NTDS" -SysvolPath "C:\Windows\SYSVOL" -CreateDnsDelegation:$false -InstallDns:$true -NoRebootOnCompletion:$false -Force:$true |
引数のおおよその意味は次のとおりです。
引数 | 意味 |
---|---|
DomainName | ドメイン名 |
DomainNetbiosName | NetBIOS 名 |
ForestMode | フォレスト機能レベル 。Win2003, Win2008, Win2008R2, Win2012, Win2012R2, WinThreshold という文字列か、対応する数値 [2-7] で指定可能。(Win2003 = 2、WinThreshold = 7) |
DomainMode | ドメイン機能レベル 。Win2003, Win2008, Win2008R2, Win2012, Win2012R2, WinThreshold という文字列か、対応する数値 [2-7] で指定可能。(Win2003 = 2、WinThreshold = 7) |
SafeModeAdministratorPassword | DSRM (ディレクトリ サービス復元モード) のパスワード |
DatabasePath | データベースを保管するフォルダーのパス |
LogPath | ログを保管するフォルダーのパス |
SysvolPath | SYSVOL フォルダーのパス |
CreateDnsDelegation | DNS 委任の作成 ($true = 作成、$false = 作成しない) |
InstallDns | DNS のインストール ($true = インストールする、$false = インストールしない) |
NoRebootOnCompletion | 完了後にコンピューターの再起動をさせないかどうか ($true = 再起動させない、$false = 再起動させる) |
Force | 警告を無視するかどうか ($true = 警告を無視、$false = 無視しない) |
気になったのは DomainMode と ForestMode に設定できる値です。正式版となっても、Win2016 とはならず、WinThreshold のまま変わっていないようです。(Win2016 と指定するとエラーになります)
昇格後に機能レベルを確認すると Windows Server 2016 という表示になるということもあるので、統一してもらいたいですね。
コマンドレットを実行すると、ドメイン コントローラーへの昇格後、自動的にコンピューターが再起動されます。以上で、昇格の作業は完了です。
ピンバック: Windows Server 2016 で AD DS (Active Directory Domain Services) のセットアップ | blog.yottun8.com