docs: fix test-environment scripts after first live run

Declare the service account DN before the OU loop and print the LDAP result
code and server message when the password-change check fails.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N3t4WL7bd9bdHHNjEsxzqC
This commit is contained in:
2026-10-17 17:56:03 +02:00
co-authored by Claude Sonnet 5.5
parent 73505ac717
commit 5f72ea8db6
2 changed files with 8 additions and 2 deletions
@@ -72,6 +72,7 @@ $domain = Get-ADDomain
$netbios = $domain.NetBIOSName
$testOuDn = "OU=$TestOuName,$ParentDn"
$svcOuDn = "OU=$ServiceOuName,$ParentDn"
$svcDn = "CN=$ServiceAccountName,$svcOuDn"
$real = -not $WhatIfPreference
$secrets = [ordered]@{}
$groups = @{}
@@ -89,7 +90,6 @@ foreach ($ou in @(@($TestOuName, $testOuDn), @($ServiceOuName, $svcOuDn))) {
}
# --- service account (outside the test OU on purpose) ------------------------
$svcDn = "CN=$ServiceAccountName,$svcOuDn"
if (Test-Dn $svcDn) {
Write-Host "Service account exists: $svcDn (password unchanged)"
}