Skip to content

Commit 2c2350e

Browse files
feat: Add isReadOnlyDC property to computer objects
1 parent 8ad304b commit 2c2350e

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/CommonLib/OutputTypes/Computer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class Computer : OutputBase {
1919
public DCRegistryData DCRegistryData { get; set; } = new();
2020
public ComputerStatus Status { get; set; }
2121
public bool IsDC { get; set; }
22+
public bool IsReadOnlyDC { get; set; }
2223
public bool UnconstrainedDelegation { get; set; }
2324
public string DomainSID { get; set; }
2425

src/CommonLib/Processors/LdapPropertyProcessor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ public async Task<ComputerProperties> ReadComputerProperties(IDirectoryObject en
356356
props.Add("unconstraineddelegation", flags.HasFlag(UacFlags.TrustedForDelegation));
357357
props.Add("trustedtoauth", flags.HasFlag(UacFlags.TrustedToAuthForDelegation));
358358
props.Add("isdc", flags.HasFlag(UacFlags.ServerTrustAccount));
359+
props.Add("isreadonlydc", flags.HasFlag(UacFlags.PartialSecretsAccount));
359360
props.Add("encryptedtextpwdallowed", flags.HasFlag(UacFlags.EncryptedTextPwdAllowed));
360361
props.Add("usedeskeyonly", flags.HasFlag(UacFlags.UseDesKeyOnly));
361362
props.Add("logonscriptenabled", flags.HasFlag(UacFlags.Script));

test/unit/LdapPropertyTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,13 +464,15 @@ public async Task LDAPPropertyProcessor_ReadComputerProperties_HappyPath()
464464
Assert.Contains("unconstraineddelegation", keys);
465465
Assert.Contains("trustedtoauth", keys);
466466
Assert.Contains("isdc", keys);
467+
Assert.Contains("isreadonlydc", keys);
467468
Assert.Contains("lastlogon", keys);
468469
Assert.Contains("lastlogontimestamp", keys);
469470
Assert.Contains("pwdlastset", keys);
470471
Assert.True((bool)props["enabled"]);
471472
Assert.False((bool)props["unconstraineddelegation"]);
472473
Assert.True((bool)props["trustedtoauth"]);
473474
Assert.False((bool)props["isdc"]);
475+
Assert.False((bool)props["isreadonlydc"]);
474476

475477
Assert.Contains("lastlogon", keys);
476478
Assert.Equal(1622827514, (long)props["lastlogon"]);

0 commit comments

Comments
 (0)