RegistryPolicy.Delete Method (RegistryHive, String, String)

 

Deletes the registry-based policy setting that is configured for the specified registry value.

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

Syntax

public void Delete(
    RegistryHive hive,
    string keyPath,
    string valueName
)
public:
void Delete(
    RegistryHive hive,
    String^ keyPath,
    String^ valueName
)
member Delete : 
        hive:RegistryHive *
        keyPath:string *
        valueName:string -> unit
Public Sub Delete (
    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