Nebula recreates the nebula1 TUN adapter on every start, wiping DNS settings. This caused domain authentication to fail at the Windows login screen because Netlogon could not reach the DC. Changes: - install-nebula.ps1 now takes -DnsServer and -Domain parameters - Changed service start type from delayed-auto to auto - Creates set-dns-on-start.ps1 startup script and NebulaDNS scheduled task - Sets ExpectedDialupDelay=60 in Netlogon registry - Idempotency check verifies scheduled task and startup script exist
48 lines
1.3 KiB
PowerShell
48 lines
1.3 KiB
PowerShell
#Requires -RunAsAdministrator
|
|
|
|
param(
|
|
[Parameter(Mandatory=$true)]
|
|
[string]$DnsServer,
|
|
|
|
[Parameter(Mandatory=$true)]
|
|
[string]$Domain,
|
|
|
|
[Parameter(Mandatory=$false)]
|
|
[string]$ComputerName
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
# Verify running as Administrator
|
|
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
|
|
$principal = [Security.Principal.WindowsPrincipal]$identity
|
|
if (-not $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
|
Write-Error "This script must be run as a machine Administrator."
|
|
exit 1
|
|
}
|
|
|
|
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
|
|
|
|
# --- Step 1: Install Nebula ---
|
|
|
|
Write-Host ""
|
|
Write-Host "=== Step 1/3: Installing Nebula ==="
|
|
& "$ScriptDir\install-nebula.ps1" -DnsServer $DnsServer -Domain $Domain
|
|
if ($LASTEXITCODE -ne 0) { exit 1 }
|
|
|
|
# --- Step 2: Set DNS ---
|
|
|
|
Write-Host ""
|
|
Write-Host "=== Step 2/3: Configuring DNS ==="
|
|
& "$ScriptDir\set-dns.ps1" -DnsServer $DnsServer
|
|
if ($LASTEXITCODE -ne 0) { exit 1 }
|
|
|
|
# --- Step 3: Join Domain ---
|
|
|
|
Write-Host ""
|
|
Write-Host "=== Step 3/3: Joining Domain ==="
|
|
$joinArgs = @{ Domain = $Domain }
|
|
if ($ComputerName) { $joinArgs.ComputerName = $ComputerName }
|
|
& "$ScriptDir\join-domain.ps1" @joinArgs
|
|
if ($LASTEXITCODE -ne 0) { exit 1 }
|