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