RegistryPolicy.Disable Method (RegistryHive, String, String)

 

Disables the registry-based policy setting that is configured for the specified registry key.

Namespace:   Microsoft.GroupPolicy
Assembly:  Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)

Syntax

public void Disable(
    RegistryHive hive,
    string keyPath,
    string valueName
)
public:
void Disable(
    RegistryHive hive,
    String^ keyPath,
    String^ valueName
)
member Disable : 
        hive:RegistryHive *
        keyPath:string *
        valueName:string -> unit
Public Sub Disable (
    hive As RegistryHive,
    keyPath As String,
    valueName As String
)

Parameters

  • valueName
    Type: System.String

    The name of the registry value. You can specify an empty string (“”) for the default value.

Exceptions

Exception Condition
ObjectDisposedException

The RegistryPolicy is disposed.

InvalidOperationException

The RegistryPolicy instance is read-only.

ArgumentNullException

keyPath is null

ArgumentException

keyPath is an empty string (“”)

-or-

hive is not CurrentUser or LocalMachine

See Also

RegistryPolicy Class
Microsoft.GroupPolicy Namespace

Return to top