Skip to content

Commit 33e676e

Browse files
RockabyeSBJclaude
andauthored
Fix duplicate-DC-DN crash in --generate-fake-reports (#353)
FakeHealthCheckDataGenerator hardcoded dc.DistinguishedName = "DC=DC" for every DC in a domain. HeatlcheckRuleAnomalyAuditDC builds a Dictionary keyed by DistinguishedName and throws on the second .Add() for any multi-DC domain, causing ~50 crashes per default-population --generate-fake-reports run (every Medium and Large domain). Replace the constant with a per-DC unique, properly-formed AD DC DN that includes the domain FQDN. Closes #352. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d3d930d commit 33e676e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

PingCastleCommon/Healthcheck/FakeHealthCheckDataGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ private void GenerateComputerData(FakeHealthCheckDataGeneratorDomainModel model,
469469
dc.CreationDate = DateBetween2Dates(healthcheckData.DomainCreation, DateTime.Now);
470470
// last logon timestam can have a delta of 14 days
471471
dc.LastComputerLogonDate = DateTime.Now.AddDays(-1 * rnd.Next(180));
472-
dc.DistinguishedName = "DC=DC";
472+
dc.DistinguishedName = "CN=" + dc.DCName + ",OU=Domain Controllers,DC=" + healthcheckData.DomainFQDN.Replace(".", ",DC=");
473473
dc.OperatingSystem = "Windows 2019";
474474
healthcheckData.DomainControllers.Add(dc);
475475
}

0 commit comments

Comments
 (0)