Provisioning fixes: auth-based readiness, domain join guards, site push
- wait for WinRM with an authenticated call, not a TCP probe: the port opens before the service can authenticate - skip promotion/join when the machine is already there, so provision is idempotent - probe the domain with System.DirectoryServices: Get-ADDomain needs RSAT, which a member server does not have - passwords must not contain the account name (Legault2024! is rejected) - Web-Dir-Browsing is the real feature name - push the site over SMB from C$: WinRM caps the command line at 8 KB
This commit is contained in:
@@ -30,9 +30,11 @@ function Fail-Stage {
|
||||
function Wait-ForDomain {
|
||||
param([int]$TimeoutSeconds = 600)
|
||||
$deadline = (Get-Date).AddSeconds($TimeoutSeconds)
|
||||
# Get-ADDomain needs the AD PowerShell module, which only exists on the DC.
|
||||
# System.DirectoryServices works on any domain-joined machine.
|
||||
while ((Get-Date) -lt $deadline) {
|
||||
try {
|
||||
$null = Get-ADDomain -ErrorAction Stop
|
||||
$null = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
|
||||
return
|
||||
} catch {
|
||||
Start-Sleep -Seconds 10
|
||||
|
||||
Reference in New Issue
Block a user