Language
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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
hive
Type: Microsoft.Win32.RegistryHiveOne of the RegistryHive values that specifies the registry hive of the key. Specify CurrentUser to delete policy settings from User Configuration. Specify LocalMachine to delete policy settings from Computer Configuration. No other values are supported.
keyPath
Type: System.StringThe path to the registry key.
valueName
Type: System.StringThe 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