RegistryPolicy.DisableKey Method (RegistryHive, String)
Disables all registry-based policy settings that are configured for first-level values under the specified registry key.
Namespace: Microsoft.GroupPolicy
Assembly: Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)
Syntax
public void DisableKey(
RegistryHive hive,
string keyPath
)
public:
void DisableKey(
RegistryHive hive,
String^ keyPath
)
member DisableKey :
hive:RegistryHive *
keyPath:string -> unit
Public Sub DisableKey (
hive As RegistryHive,
keyPath 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.
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