⭐⭐How to promote a Domain controller with a single powershell command
Vložit
- čas přidán 5. 09. 2024
- How to promote a Domain controller with a single powershell command
---------------------------------------------------------------------------------------------------------------------
Configurar la red
$ipAddress = "10.0.0.16"
$prefixLength = 24
$gateway = "10.0.0.1"
$dnsServer = "127.0.0.1"
$interfaceAlias = (Get-NetAdapter | Where-Object { $_.Status -eq "Up" }).InterfaceAlias
Configura la dirección IP
New-NetIPAddress -IPAddress $ipAddress -PrefixLength $prefixLength -InterfaceAlias $interfaceAlias -DefaultGateway $gateway
Configura el servidor DNS
Set-DnsClientServerAddress -InterfaceAlias $interfaceAlias -ServerAddresses $dnsServer
Asegúrate de que la configuración de red esté completa antes de continuar
Start-Sleep -Seconds 10
Crear la contraseña de modo seguro como SecureString
$securePassword = ConvertTo-SecureString -String "S***3331404" -AsPlainText -Force
Instalar AD DS y configurar el bosque
Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools
Import-Module ADDSDeployment
Install-ADDSForest `
-CreateDnsDelegation:$false `
-DatabasePath "C:\Windows\NTDS" `
-DomainMode "WinThreshold" `
-DomainName "CONTOCSO.LOCAL" `
-DomainNetbiosName "CONTOCSO" `
-ForestMode "WinThreshold" `
-InstallDns:$true `
-LogPath "C:\Windows\NTDS" `
-NoRebootOnCompletion:$false `
-SysvolPath "C:\Windows\SYSVOL" `
-SafeModeAdministratorPassword $securePassword `
-Force:$true