TestimoX

API Reference

Class

OfflineRegistryPolicySource

Namespace ADPlayground.Gpo.GpoLocal
Assembly ADPlayground
Implements
IPolicySource IDisposable
Modifiers sealed

An IPolicySource implementation backed by an offline registry hive mounted temporarily under HKEY_USERS or HKEY_LOCAL_MACHINE using RegLoadKey.

Inheritance

  • Object
  • OfflineRegistryPolicySource

Constructors

public OfflineRegistryPolicySource(RegistryKey rootKey) #

Initializes a new instance over an existing RegistryKey that represents the root of the offline hive (already mounted by the caller).

Parameters

rootKey Microsoft.Win32.RegistryKey requiredposition: 0

Methods

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

Deletes all values under the specified key in the offline hive.

Parameters

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

Determines whether the specified value exists in the offline hive.

Parameters

key System.String requiredposition: 0
Registry key path.
value System.String requiredposition: 1
Registry value name.

Returns

True when the value exists.

public virtual Void DeleteValue(String key, String value) #
Returns: Void

Deletes a value from the offline hive if present.

Parameters

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

Disposes the underlying registry key and hive handle.

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

Stops tracking key clearance. No-op for this implementation.

Parameters

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

Stops tracking a value change. No-op for this implementation.

Parameters

key System.String requiredposition: 0
value System.String requiredposition: 1
public static OfflineRegistryPolicySource FromMachineHive(String hivePath, String mountName = null) #
Returns: OfflineRegistryPolicySource

Loads a machine hive (e.g., SOFTWARE) under HKEY_LOCAL_MACHINE and exposes it as a policy source.

Parameters

hivePath System.String requiredposition: 0
Path to the hive file (e.g., C:\\Windows\\System32\\config\\SOFTWARE).
mountName System.String = null optionalposition: 1
Mount name under HKEY_LOCAL_MACHINE (e.g., "Temp_SOFTWARE").
public static OfflineRegistryPolicySource FromUserHive(String ntUserDatPath, String mountName = null) #
Returns: OfflineRegistryPolicySource

Loads a user hive (NTUSER.DAT) under HKEY_USERS and exposes it as a policy source.

Parameters

ntUserDatPath System.String requiredposition: 0
Path to NTUSER.DAT.
mountName System.String = null optionalposition: 1
Mount name under HKEY_USERS (e.g., "Temp_Offline").
public virtual IReadOnlyList<String> GetSubKeyNames(String key) #
Returns: IReadOnlyList<String>

Gets subkey names under the specified key.

Parameters

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

Gets a registry value from the offline hive without expanding environment variables.

Parameters

key System.String requiredposition: 0
Registry key path.
value System.String requiredposition: 1
Registry value name.

Returns

Value data or null when missing.

public virtual IReadOnlyList<String> GetValueNames(String key) #
Returns: IReadOnlyList<String>

Gets all value names defined under the specified key.

Parameters

key System.String requiredposition: 0
Registry key path.

Returns

List of value names; empty when not found.

public virtual Void SetValue(String key, String value, Object data, RegistryValueKind dataType) #
Returns: Void

Writes a value to the offline hive.

Parameters

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

Indicates whether the specified value is scheduled for deletion. Always false for this implementation.

Parameters

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