WLAN-Profile, portables OpenVPN und automatischer AD-Join

- WLAN-Tab: SSIDs (WPA2/WPA3/offen, versteckt) in Blaupausen speichern,
  fuer alle Benutzer anlegen, Profile eines Referenzgeraets uebernehmen
- OpenVPN portabel: offizielles MSI per msiexec /a entpackt + Microsoft-
  signierter TAP-Treiber in tools\openvpn; Treiber wird nur temporaer
  geladen und danach entfernt (--disable-dco, --dev-node)
- .ovpn/Zertifikate je Kunde hochladen, Benutzer/Kennwort optional
- AD-Join mit DC-Test (SRV+LDAP), OU, Umbenennung, lokalen Admins,
  optional ueber VPN; VPN optional als Dienst fuer die erste Anmeldung
- Fehlende Kennwoerter werden beim Start abgefragt und nicht gespeichert

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-09 16:29:07 +02:00
co-authored by Claude Opus 5.5
parent ebfec7000e
commit 46a969ee90
8 changed files with 692 additions and 4 deletions
+20
View File
@@ -216,6 +216,26 @@ function Invoke-Api {
$active = (powercfg /getactivescheme) -join ''
return Send-Json $Ctx @{ active = $active; hibernate = [bool](Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Power' -Name HibernateEnabled -ErrorAction SilentlyContinue).HibernateEnabled }
}
# WLAN
'^GET /api/wifi$' { return Send-Json $Ctx (Get-WifiState) }
'^POST /api/wifi/apply$' { $b = Read-Body $Ctx; return Send-Json $Ctx @{ job = (Add-KdsJob "WLAN-Profile anlegen ($(@($b.wifi).Count))" 'Add-WifiProfiles' $b) } }
'^POST /api/wifi/import$' { return Send-Json $Ctx @(Export-WifiProfiles) }
'^POST /api/wifi/connect$' { $b = Read-Body $Ctx; $o = netsh wlan connect name="$($b.ssid)" 2>&1; return Send-Json $Ctx @{ ok = ($LASTEXITCODE -eq 0); message = ($o -join ' ') } }
'^DELETE /api/wifi$' { netsh wlan delete profile name="$($q['ssid'])" | Out-Null; return Send-Json $Ctx @{ ok = $true } }
# OpenVPN (portabel) + Domaene
'^GET /api/vpn$' {
$files = @(Get-ChildItem (Join-Path $global:KdsRoot 'vpn') -File -ErrorAction SilentlyContinue | Where-Object Name -notlike '.*' | ForEach-Object Name)
return Send-Json $Ctx ([pscustomobject]@{ status = (Get-VpnStatus); portable = (Get-OpenVpnPortableInfo); files = $files })
}
'^POST /api/vpn/build$' { return Send-Json $Ctx @{ job = (Add-KdsJob 'Portables OpenVPN erstellen' 'New-OpenVpnPortable' @{}) } }
'^POST /api/vpn/connect$' { $b = Read-Body $Ctx; return Send-Json $Ctx @{ job = (Add-KdsJob "VPN verbinden ($($b.vpn.config))" 'Connect-KdsVpn' $b) } }
'^POST /api/vpn/disconnect$' { $n = Disconnect-KdsVpn; Remove-PortableTap; return Send-Json $Ctx @{ ok = $true; stopped = $n } }
'^POST /api/vpn/service$' { $b = Read-Body $Ctx; return Send-Json $Ctx @{ job = (Add-KdsJob 'VPN als Dienst einrichten' 'Install-KdsVpnService' $b) } }
'^DELETE /api/vpn/service$' { Remove-KdsVpnService; return Send-Json $Ctx @{ ok = $true } }
'^POST /api/domain/test$' { $b = Read-Body $Ctx; return Send-Json $Ctx (Test-KdsDomain $b.name) }
'^POST /api/domain/join$' { $b = Read-Body $Ctx; return Send-Json $Ctx @{ job = (Add-KdsJob "Domaenenbeitritt $($b.domain.name)" 'Join-KdsDomain' $b) } }
'^GET /api/bloatware$' { return Send-Json $Ctx @(Get-BloatwareInventory) }
'^POST /api/bloatware$' { $b = Read-Body $Ctx; return Send-Json $Ctx @{ job = (Add-KdsJob 'Bloatware entfernen' 'Remove-Bloatware' $b) } }
'^GET /api/bitlocker$' { return Send-Json $Ctx (Get-BitLockerInfo) }