#$config = Get-Content -Raw -Path ".\config.json" | ConvertFrom-Json if (-not (Get-WindowsFeature -Name AD-Domain-Services).Installed) { Write-Host "Le role AD DS n'est pas installer." -ForegroundColor Red Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools } if (-not (Get-WindowsFeature -Name DNS).Installed) { Write-Host "Le role DNS n'est pas installer." -ForegroundColor Red Install-WindowsFeature -Name DNS -IncludeManagementTools } $dom = Read-Host "Domain Parent (nom.local) " #$net = Read-Host "Nom NetBIOS " $pwdsafe = Read-Host "DSRM password " -AsSecureString $creds = Get-Credential Install-ADDSDomainController ` -DomainName $dom ` -SafeModeAdministratorPassword $pwdsafe ` -Credential $creds ` -InstallDNS $true ` -DatabasePath "C:\Windows\NTDS" ` -LogPath "C:\Windows\NTDS" ` -SYSVOLPath "C:\Windows\SYSVOL" ` -ReplicationSourceDC $dom ` -NoRebootOnCompletion $false ` -Force $true