Phase 5: AD role scripts, WinRM provisioning and lab wordlist

dc01 promotes the forest then runs a startup-scheduled post stage for OUs,
users, groups, the SPN on svc_backup, pre-auth disabled on j.contractor,
GenericAll over t.smith, the www A record, flags and advanced audit policy.
fs01 installs IIS, shares the web root's public/ as \\FS01\Public and joins.
ws01 joins, then adds WS Admins to local Administrators.

provision uploads over WinRM, starts scripts detached, waits on a .done
marker and survives the promotion reboot.
This commit is contained in:
2026-10-21 19:29:51 -04:00
parent a38acd3946
commit 279f4cc547
13 changed files with 2570 additions and 6 deletions
+29
View File
@@ -0,0 +1,29 @@
# Norbourg lab — WS01: domain-joined workstation.
# Stage 2 runs after the join reboot because local group membership needs the
# domain group to resolve.
. "$PSScriptRoot\..\lib\common.ps1"
$self = $PSCommandPath
Write-LabLog 'ws01: starting'
try {
$post = Join-Path $PSScriptRoot 'ws01-post.ps1'
if (-not (Test-Path $post)) { Fail-Stage $self 'ws01-post.ps1 missing' }
$null = schtasks.exe /Create /TN 'NorbourgWsPost' /F /SC ONSTART /RU SYSTEM /RL HIGHEST `
/TR "powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"$post`""
$cred = New-Object System.Management.Automation.PSCredential(
'@@DOMAIN@@\Administrator',
(ConvertTo-SecureString '@@ADMIN_PASSWORD@@' -AsPlainText -Force))
Write-LabLog 'ws01: joining the domain'
Add-Computer -DomainName '@@DOMAIN@@' -Credential $cred `
-OUPath 'OU=Ordinateurs,OU=Norbourg,@@BASE_DN@@' -Force
Complete-Stage $self 'ok reboot'
Restart-Computer -Force
} catch {
Fail-Stage $self $_.Exception.Message
}