TestimoX

API Reference

Class

LgpoReaderWriter

Namespace ComputerX.Lgpo
Assembly ComputerX
Modifiers static

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 requiredposition: 0
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 requiredposition: 0
Target host name or null/. for local machine.
scope ComputerX.Lgpo.LgpoReaderWriter.Scope requiredposition: 1
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: String

Serializes LGPO items to a pretty‑printed JSON string.

Parameters

items System.Collections.Generic.IEnumerable{ComputerX.Lgpo.LgpoPolItem} requiredposition: 0
Items to serialize.

Returns

JSON text.

public static Boolean Write(String computerName, Scope scope, IEnumerable<LgpoPolItem> items, Boolean merge, Boolean backup) #
Returns: Boolean

Writes the specified entries to Registry.pol at the given scope.

Parameters

computerName System.String requiredposition: 0
Target host name or null/. for local machine.
scope ComputerX.Lgpo.LgpoReaderWriter.Scope requiredposition: 1
Policy scope to write (Machine or User).
items System.Collections.Generic.IEnumerable{ComputerX.Lgpo.LgpoPolItem} requiredposition: 2
Entries to write. Use Data = null to delete a value.
merge System.Boolean requiredposition: 3
When true, merges with existing entries; otherwise overwrites.
backup System.Boolean requiredposition: 4
When true, creates a timestamped backup of the existing file.

Returns

true after writing completes.