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:
2026-10-21 20:02:43 -04:00
parent bb8a6a6eb0
commit 645adea875
9 changed files with 83 additions and 34 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ except ImportError: # pragma: no cover
print("pywinrm is not installed: python3 -m pip install --user pywinrm", file=sys.stderr)
raise SystemExit(2)
CHUNK = 1400 # keep each WinRM command well under the payload limit
CHUNK = 1500 # -EncodedCommand is UTF-16, so 1500 chars becomes ~4000 base64 chars
def connect(host: str, user: str, password: str, port: int) -> "winrm.Session":