API Reference
Class
LgpoReaderWriter
Read/write helpers for Local Group Policy objects (Registry.pol), including JSON import/export.
Inheritance
- Object
- LgpoReaderWriter
Methods
public static LgpoPolItem[] FromJson(String json) #Returns:
LgpoPolItem[]Deserializes LGPO items from JSON text produced by LgpoPolItem>).
Parameters
- json System.String
- JSON string.
Returns
Deserialized items or an empty array.
public static LgpoPolItem[] Read(String computerName, Scope scope) #Returns:
LgpoPolItem[]Reads the Registry.pol at the given scope and returns the entries as LgpoPolItem objects.
Parameters
- computerName System.String
- Target host name or null/. for local machine.
- scope ComputerX.Lgpo.LgpoReaderWriter.Scope
- Policy scope to read (Machine or User).
Returns
Array of LGPO entries; empty when the file is missing.
public static String ToJson(IEnumerable<LgpoPolItem> items) #Returns:
StringSerializes LGPO items to a pretty‑printed JSON string.
Parameters
- items System.Collections.Generic.IEnumerable{ComputerX.Lgpo.LgpoPolItem}
- Items to serialize.
Returns
JSON text.
public static Boolean Write(String computerName, Scope scope, IEnumerable<LgpoPolItem> items, Boolean merge, Boolean backup) #Returns:
BooleanWrites the specified entries to Registry.pol at the given scope.
Parameters
- computerName System.String
- Target host name or null/. for local machine.
- scope ComputerX.Lgpo.LgpoReaderWriter.Scope
- Policy scope to write (Machine or User).
- items System.Collections.Generic.IEnumerable{ComputerX.Lgpo.LgpoPolItem}
- Entries to write. Use Data = null to delete a value.
- merge System.Boolean
- When true, merges with existing entries; otherwise overwrites.
- backup System.Boolean
- When true, creates a timestamped backup of the existing file.
Returns
true after writing completes.
Inherited Methods
public override Boolean Equals(Object obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object