API Reference
PolFile
Represents a .pol file and allows policy manipulation.
Inheritance
- Object
- PolFile
Constructors
public PolFile() #Methods
public Void AddEntry(PolEntry entry) #VoidAdds 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
public Void Apply(IPolicySource target) #VoidApplies this POL model to the target policy source.
Parameters
- target ADPlayground.Gpo.GpoLocal.IPolicySource
public Void ApplyDifference(PolFile oldVersion, IPolicySource target) #VoidApplies the difference between this instance and an optional old version to a target policy source.
Parameters
- oldVersion ADPlayground.Gpo.GpoLocal.PolFile
- Baseline to diff against; pass null to treat all entries as added.
- target ADPlayground.Gpo.GpoLocal.IPolicySource
- Destination policy source.
public virtual Void ClearKey(String key) #VoidClears all values under a key (adds **delvals marker).
Parameters
- key System.String
public virtual Boolean ContainsValue(String key, String value) #BooleanDetermines whether a value exists (and is not marked for deletion) in this in-memory POL model.
Parameters
- key System.String
- value System.String
public virtual Void DeleteValue(String key, String value) #VoidMarks a value for deletion, preserving policy semantics.
Parameters
- key System.String
- value System.String
public IEnumerable<PolEntry> Enumerate() #IEnumerable<PolEntry>Enumerates entries in write order.
public virtual Void ForgetKeyClearance(String key) #VoidRemoves pending key-clearance markers for the given key.
Parameters
- key System.String
public virtual Void ForgetValue(String key, String value) #VoidRemoves a value and clears any pending deletion markers.
Parameters
- key System.String
- value System.String
public IReadOnlyList<String> GetKeyNames(String key) #IReadOnlyList<String>Gets subkey names directly under the provided key path.
Parameters
- key System.String
public virtual IReadOnlyList<String> GetSubKeyNames(String key) #IReadOnlyList<String>Gets subkey names under the specified key by inspecting entry prefixes.
Parameters
- key System.String
public virtual Object GetValue(String key, String value) #ObjectGets a value as a .NET object (string, uint, string[], etc.) if present.
Parameters
- key System.String
- value System.String
public RegistryValueKind GetValueKind(String key, String value) #RegistryValueKindGets the registry value kind for a given entry.
Parameters
- key System.String
- value System.String
public virtual IReadOnlyList<String> GetValueNames(String key) #IReadOnlyList<String>Gets all value names under a given key.
Parameters
- key System.String
public static PolFile Load(String file) #PolFileLoads a .pol file from disk (delegates parse to ComputerX.Lgpo).
Parameters
- file System.String
- Path to the file.
Returns
Loaded PolFile.
public Void Save(String file) #VoidSaves this instance to disk (delegates serialization to ComputerX.Lgpo).
Parameters
- file System.String
- Destination file path.
public virtual Void SetValue(String key, String value, Object data, RegistryValueKind dataType) #VoidSets or replaces a value in the POL model.
Parameters
- key System.String
- value System.String
- data System.Object
- dataType Microsoft.Win32.RegistryValueKind
public virtual Boolean WillDeleteValue(String key, String value) #BooleanReturns true if the value is scheduled for deletion based on **del.* entries.
Parameters
- key System.String
- value System.String