TestimoX

API Reference

Class

RegistryPolicyProxy

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

Proxies IPolicySource calls to the Windows registry.

Inheritance

  • Object
  • RegistryPolicyProxy

Constructors

RegistryPolicyProxy 2 overloads
public RegistryPolicyProxy(RegistryHive hive, RegistryView view = Default) #

Initializes a new instance wrapping an existing key.

Parameters

key Microsoft.Win32.RegistryKey requiredposition: 0
Root registry key.
ownsKey System.Boolean = Default optionalposition: 1
When true, the key will be disposed with this instance.
RegistryPolicyProxy(Microsoft.Win32.RegistryHive hive, Microsoft.Win32.RegistryView view) #

Initializes a new instance for the specified hive.

Parameters

hive Microsoft.Win32.RegistryHive required
Registry hive to open.
view Microsoft.Win32.RegistryView required
Registry view.

Methods

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

Deletes all values under the specified key (does not remove the key itself).

Parameters

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

Determines whether the specified registry value exists.

Parameters

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

Returns

true if the value is present; otherwise false.

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

Deletes the specified value if it exists.

Parameters

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

Releases resources associated with this proxy. If this instance owns the root key, the underlying RegistryKey is disposed.

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

Stops tracking key clearance operations. No-op for live registry sources.

Parameters

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

Stops tracking the specified value. No-op for live registry sources.

Parameters

key System.String requiredposition: 0
Registry key path.
value System.String requiredposition: 1
Registry value name.
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 the registry value data for the specified key/value.

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 the key does not exist.

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

Sets a registry value.

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 to be deleted. For live registry sources, deletion is executed immediately so this always returns false.

Parameters

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

Returns

Always false for this implementation.

Properties

public RegistryKey RootKey { get; } #

Gets the wrapped root key.