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:
@@ -8,9 +8,16 @@ $self = $PSCommandPath
|
||||
Write-LabLog 'fs01: starting'
|
||||
|
||||
try {
|
||||
# Re-running provision must not try to join a machine that already joined.
|
||||
if ((Get-CimInstance Win32_ComputerSystem).Domain -eq '@@DOMAIN@@') {
|
||||
Write-LabLog 'fs01: already joined'
|
||||
Complete-Stage $self 'ok'
|
||||
return
|
||||
}
|
||||
|
||||
$features = @(
|
||||
'Web-Server', 'Web-Common-Http', 'Web-Default-Doc',
|
||||
'Web-Static-Content', 'Web-Directory-Browsing', 'Web-Http-Logging'
|
||||
'Web-Static-Content', 'Web-Dir-Browsing', 'Web-Http-Logging'
|
||||
)
|
||||
foreach ($f in $features) {
|
||||
if (-not (Get-WindowsFeature -Name $f).Installed) {
|
||||
|
||||
Reference in New Issue
Block a user