TestimoX

API Reference

Class

PolFile

Namespace ADPlayground.Gpo.GpoLocal
Assembly ADPlayground
Implements
Modifiers sealed

Represents a .pol file and allows policy manipulation.

Inheritance

  • Object
  • PolFile

Constructors

Methods

public Void AddEntry(PolEntry entry) #
Returns: Void

Adds a raw entry into this in-memory POL model. Intended for scenarios where a merged effective policy needs to be analyzed using the PolicyProcessing helpers without loading from disk.

Parameters

entry ADPlayground.Gpo.GpoLocal.PolEntry requiredposition: 0
public Void Apply(IPolicySource target) #
Returns: Void

Applies this POL model to the target policy source.

Parameters

target ADPlayground.Gpo.GpoLocal.IPolicySource requiredposition: 0
public Void ApplyDifference(PolFile oldVersion, IPolicySource target) #
Returns: Void

Applies the difference between this instance and an optional old version to a target policy source.

Parameters

oldVersion ADPlayground.Gpo.GpoLocal.PolFile requiredposition: 0
Baseline to diff against; pass null to treat all entries as added.
target ADPlayground.Gpo.GpoLocal.IPolicySource requiredposition: 1
Destination policy source.
public virtual Void ClearKey(String key) #
Returns: Void

Clears all values under a key (adds **delvals marker).

Parameters

key System.String requiredposition: 0
public virtual Boolean ContainsValue(String key, String value) #
Returns: Boolean

Determines whether a value exists (and is not marked for deletion) in this in-memory POL model.

Parameters

key System.String requiredposition: 0
value System.String requiredposition: 1
public virtual Void DeleteValue(String key, String value) #
Returns: Void

Marks a value for deletion, preserving policy semantics.

Parameters

key System.String requiredposition: 0
value System.String requiredposition: 1
public IEnumerable<PolEntry> Enumerate() #
Returns: IEnumerable<PolEntry>

Enumerates entries in write order.

public virtual Void ForgetKeyClearance(String key) #
Returns: Void

Removes pending key-clearance markers for the given key.

Parameters

key System.String requiredposition: 0
public virtual Void ForgetValue(String key, String value) #
Returns: Void

Removes a value and clears any pending deletion markers.

Parameters

key System.String requiredposition: 0
value System.String requiredposition: 1
public IReadOnlyList<String> GetKeyNames(String key) #
Returns: IReadOnlyList<String>

Gets subkey names directly under the provided key path.

Parameters

key System.String requiredposition: 0
public virtual IReadOnlyList<String> GetSubKeyNames(String key) #
Returns: IReadOnlyList<String>

Gets subkey names under the specified key by inspecting entry prefixes.

Parameters

key System.String requiredposition: 0
public virtual Object GetValue(String key, String value) #
Returns: Object

Gets a value as a .NET object (string, uint, string[], etc.) if present.

Parameters

key System.String requiredposition: 0
value System.String requiredposition: 1
public RegistryValueKind GetValueKind(String key, String value) #
Returns: RegistryValueKind

Gets the registry value kind for a given entry.

Parameters

key System.String requiredposition: 0
value System.String requiredposition: 1
public virtual IReadOnlyList<String> GetValueNames(String key) #
Returns: IReadOnlyList<String>

Gets all value names under a given key.

Parameters

key System.String requiredposition: 0
public static PolFile Load(String file) #
Returns: PolFile

Loads a .pol file from disk (delegates parse to ComputerX.Lgpo).

Parameters

file System.String requiredposition: 0
Path to the file.

Returns

Loaded PolFile.

public Void Save(String file) #
Returns: Void

Saves this instance to disk (delegates serialization to ComputerX.Lgpo).

Parameters

file System.String requiredposition: 0
Destination file path.
public virtual Void SetValue(String key, String value, Object data, RegistryValueKind dataType) #
Returns: Void

Sets or replaces a value in the POL model.

Parameters

key System.String requiredposition: 0
value System.String requiredposition: 1
data System.Object requiredposition: 2
dataType Microsoft.Win32.RegistryValueKind requiredposition: 3
public virtual Boolean WillDeleteValue(String key, String value) #
Returns: Boolean

Returns true if the value is scheduled for deletion based on **del.* entries.

Parameters

key System.String requiredposition: 0
value System.String requiredposition: 1