From b8c893bd4e6e98bc76d92f790323ca651e4730be Mon Sep 17 00:00:00 2001 From: Tomas Kracmar Date: Mon, 16 Nov 2026 11:10:05 +0100 Subject: [PATCH] chore(release): v2.6.1 fix: skip RoamedCredentials property set in Get-ADReplAccount -All so a single account with a malformed credential-roaming blob no longer aborts the whole password-quality replication (DSInternals ThrowIfNotEqual '%'). --- CHANGELOG.md | 5 +++++ src/Elysium/Elysium.psd1 | 2 +- src/Elysium/Private/PasswordQuality.ps1 | 17 ++++++++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dab087..33ab36f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ Starting with **v2.2.0**, Elysium uses a **unified project version**. All script --- +## [2.6.1] — 2026-11-16 + +### Fixed +- **`Test-WeakADPasswords` aborted on domains with malformed credential-roaming data:** DSInternals parses the credential-roaming blob (the `msPKI*` attributes written by legacy Certificate/Credential Roaming) strictly — the first byte must be `%` — and throws `System.ArgumentOutOfRangeException` ("Value must be equal to %") on any account whose roaming data is corrupt. `Get-ADReplAccount -All` returns a lazy enumerable, so that single bad account aborted the whole replication and no passwords were tested (surfaced as a DCSYNC diagnostic dump). The replication call now requests every account property set except `RoamedCredentials`, which password quality never uses, so the malformed blob is never parsed. No change to results. Falls back to a plain `-All` on DSInternals versions older than 7.x that lack the `-Properties` parameter. + ## [2.6.0] — 2026-11-06 ### Added diff --git a/src/Elysium/Elysium.psd1 b/src/Elysium/Elysium.psd1 index 3fa12d5..d279225 100644 --- a/src/Elysium/Elysium.psd1 +++ b/src/Elysium/Elysium.psd1 @@ -2,7 +2,7 @@ RootModule = 'Elysium.psm1' # Single source of the project version: the root scripts, User-Agent strings and the usage # beacon all read it from here. - ModuleVersion = '2.6.0' + ModuleVersion = '2.6.1' GUID = '01fbd208-0a80-42b4-b464-3be903feeb25' Author = 'CQRE.NET' CompanyName = 'CQRE.NET' diff --git a/src/Elysium/Private/PasswordQuality.ps1 b/src/Elysium/Private/PasswordQuality.ps1 index 69761aa..15221c0 100644 --- a/src/Elysium/Private/PasswordQuality.ps1 +++ b/src/Elysium/Private/PasswordQuality.ps1 @@ -299,7 +299,22 @@ function Invoke-WeakPasswordTest { $resolvedHashFile = $null try { $resolvedHashFile = Resolve-DSInternalsWeakHashFile -Path $FilePath - $accounts = Get-ADReplAccount -All -Server $selectedDomain["DC"] -Credential $credential + + # Request all account properties EXCEPT RoamedCredentials. DSInternals parses the + # credential-roaming blob (msPKI* attributes) strictly - the first byte must be '%' - + # and throws ArgumentOutOfRangeException ("Value must be equal to %") on any account + # whose legacy roaming data is malformed. Because Get-ADReplAccount -All yields a lazy + # enumerable, that single bad account aborts the entire replication. Password quality + # never uses roamed credentials, so dropping the property set makes the run robust with + # no change to results. The -Properties parameter exists since DSInternals 7.x; fall + # back to a plain -All on older modules that lack it. + $replParams = @{ All = $true; Server = $selectedDomain["DC"]; Credential = $credential } + if ((Get-Command Get-ADReplAccount).Parameters.ContainsKey('Properties')) { + $allProps = [DSInternals.Common.Data.AccountPropertySets]::All + $roamed = [DSInternals.Common.Data.AccountPropertySets]::RoamedCredentials + $replParams['Properties'] = $allProps -band (-bnot $roamed) + } + $accounts = Get-ADReplAccount @replParams if ($CheckOnlyEnabledUsers) { Write-Verbose "Filtering to only enabled users per settings." # Prefer property 'Enabled' if present, fall back gracefully if not