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
hive
Type: Microsoft.Win32.RegistryHiveOne of the RegistryHive values that specifies the registry hive of the key. Specify CurrentUser to disable policy settings in User Configuration. Specify LocalMachine to disable policy settings in 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