TestimoX

API Reference

Class

GpoRegistryPolicyService

Namespace ADPlayground.Gpo.Policy
Assembly ADPlayground
Modifiers static

Reads registry policy (registry.pol) from GPOs and computes effective values for a target DN. Designed for reuse by TestimoX and PowerShell cmdlets.

Inheritance

  • Object
  • GpoRegistryPolicyService

Methods

public static Void ClearRegistryPolCache(String domainName = null) #
Returns: Void

Clears the in-memory cache of per-GPO registry.pol entries. When domainName is provided, only entries for that domain are removed.

Parameters

domainName System.String = null optionalposition: 0
public static Boolean DeletesValue(String domainName, Guid gpoId, RegistryPolicyScope scope, String keyPath, String valueName) #
Returns: Boolean

Returns true when the specified GPO's registry.pol contains a deletion marker that removes the given (key,value) pair. This inspects **del.<value> / **delvals / **deletevalues markers (machine scope only supports HKLM/MACHINE keys).

Parameters

domainName System.String requiredposition: 0
gpoId System.Guid requiredposition: 1
scope ADPlayground.Gpo.Policy.RegistryPolicyScope requiredposition: 2
keyPath System.String requiredposition: 3
valueName System.String requiredposition: 4
public static GpoRegistryPolicySet GetEffectiveComputerPolicyForDomainControllers(String domainName) #
Returns: GpoRegistryPolicySet

Computes the effective Computer Configuration registry policy for the Domain Controllers OU.

Parameters

domainName System.String requiredposition: 0
GetEffectivePolicyForDn 2 overloads
public static GpoRegistryPolicySet GetEffectivePolicyForDn(String domainName, String distinguishedName, RegistryPolicyScope scope, Boolean includeSiteGpos = false, IEnumerable<String> siteNames = null) #
Returns: GpoRegistryPolicySet

Computes the effective registry policy for an arbitrary target distinguishedName. Site-level is not considered in this version.

Parameters

domainName System.String requiredposition: 0
distinguishedName System.String requiredposition: 1
scope ADPlayground.Gpo.Policy.RegistryPolicyScope requiredposition: 2
includeSiteGpos System.Boolean = false optionalposition: 3
siteNames System.Collections.Generic.IEnumerable{System.String} = null optionalposition: 4
public static GpoRegistryPolicySet GetEffectivePolicyForDn(String domainName, String distinguishedName, RegistryPolicyScope scope, IReadOnlyList<Guid> orderedGpoIds) #
Returns: GpoRegistryPolicySet

Computes the effective registry policy for a target DN using a pre-filtered ordered list of GPO identifiers.

Parameters

domainName System.String requiredposition: 0
distinguishedName System.String requiredposition: 1
scope ADPlayground.Gpo.Policy.RegistryPolicyScope requiredposition: 2
orderedGpoIds System.Collections.Generic.IReadOnlyList{System.Guid} requiredposition: 3
public static IEnumerable<RegistryPolicyEntry> GetEntriesForGpo(String domainName, Guid gpoId, RegistryPolicyScope scope) #
Returns: IEnumerable<RegistryPolicyEntry>

Gets entries from a specific GPO.

Parameters

domainName System.String requiredposition: 0
gpoId System.Guid requiredposition: 1
scope ADPlayground.Gpo.Policy.RegistryPolicyScope requiredposition: 2
public static Boolean IsGpoEnabledForScope(String domainName, Guid id, RegistryPolicyScope scope) #
Returns: Boolean

Returns whether the specified GPO is enabled for the given configuration scope (User or Computer). Evaluates the flags attribute on the GPO and interprets per-scope disabled bits.

Parameters

domainName System.String requiredposition: 0
DNS domain containing the GPO.
id System.Guid requiredposition: 1
GPO GUID.
scope ADPlayground.Gpo.Policy.RegistryPolicyScope requiredposition: 2
Configuration scope to test.

Returns

true when the scope is enabled (not disabled) on this GPO; otherwise false.

public static IReadOnlyList<AppliedGpoLink> ResolveAppliedGposForDnDetailed(String domainName, String distinguishedName, Boolean includeSites, IEnumerable<String> siteNames) #
Returns: IReadOnlyList<AppliedGpoLink>

Returns ordered applied GPO link details (ID + DN/domain DN) for the specified target DN.

Parameters

domainName System.String requiredposition: 0
distinguishedName System.String requiredposition: 1
includeSites System.Boolean requiredposition: 2
siteNames System.Collections.Generic.IEnumerable{System.String} requiredposition: 3