Removes one or more registry-based policy settings from either Computer Configuration or User Configuration in a GPO.
Active Directory · Risk: Critical · Documentation Verified
Last verified: 2026-10-26
Microsoft GroupPolicy reference: Removes one or more registry-based policy settings from either Computer Configuration or User Configuration in a GPO. The syntax and selected example below are adapted from the pinned Windows Server 2025 reference. Module availability, target configuration and delegated permissions determine whether it can run in your environment. Documentation and parameter text: Microsoft, CC BY 4.0; formatting adapted by Cmdlet World. No execution testing is claimed.
Use an account with the target resource permissions documented for Remove-GPRegistryValue. Modifying administrative cmdlets may require elevation or delegated administration. This catalog does not assert that ordinary users can execute the command.
Supported environments
Windows / GroupPolicy · Windows Server 2025 documentation; feature/module prerequisites apply
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
-Domain
Specifies the domain for this cmdlet. You must specify the fully qualified domain name (FQDN) of the domain. For the Remove-GPRegistryValue cmdlet, the GPO from which to remove the registry-based policy setting must exist in this domain. If you do not specify the Domain parameter, the domain of the user that is running the current session is used. If the cmdlet is being run from a computer startup or shutdown script, the domain of the computer is used. For more information, see the Notes section in the full Help. If you specify a domain that is different from the domain of the user that is running the current session (or, for a startup or shutdown script, the computer), a trust must exist between that domain and the domain of the user or the computer. You can also refer to the Domain parameter by its built-in alias, DomainName. For more information, see about_Aliases.
-Guid (required)
Specifies the GPO from which to remove the registry-based policy setting by its globally unique identifier (GUID). The GUID uniquely identifies the GPO. You can also refer to the Guid parameter by its built-in alias, Id.
-Key (required)
Specifies a registry key for which to remove one or more registry-based policy settings (for instance: HKLM\Software\Policies\Microsoft\WindowsNT\DNSClient\UseDomainNameDevolution). The key must be in one of the two following registry hives: - HKEY_LOCAL_MACHINE (HKLM) for a registry-based policy setting in Computer Configuration. - HKEY_CURRENT_USER (HKCU) for a registry-based policy setting in User Configuration. The Key parameter can be specified with or without the ValueName parameter: - If the ValueName parameter is specified, the registry-based policy setting that configures that registry value is removed. - If the ValueName parameter is not specified, all registry-based policy settings that configure any of the first-level values of the registry key are removed. If there are registry-based policy settings that configure any subkeys or their values, an error occurs. You can also refer to the Key parameter by its built-in alias, FullKeyPath.
-Name (required)
Specifies the GPO from which to remove the registry-based policy setting by its display name. The display name is not guaranteed to be unique in the domain. If another GPO with the same display name exists in the domain an error occurs. You can use the Guid parameter to uniquely identify a GPO. You can also refer to the Name parameter by its built-in alias, DisplayName.
-Server
Specifies the name of the domain controller that this cmdlet contacts to complete the operation. You can specify either the fully qualified domain name (FQDN) or the host name. If you do not specify the name by using the Server parameter, the primary domain controller (PDC) emulator is contacted. You can also refer to the Server parameter by its built-in alias, DC.
-ValueName
Specifies the name of the registry value for which to remove the registry-based policy setting. If you specify the ValueName parameter, you must also specify the Key parameter.
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Prerequisites
Windows with the GroupPolicy module and the Windows feature or management tools that provide it. Confirm target connectivity and version compatibility using the linked Microsoft reference.
Security considerations
This cmdlet changes system state. Review every target and parameter in the official reference, test outside production, and prepare an appropriate backup or rollback. Do not execute the example automatically.
Examples
Example 1: Remove a registry-based policy setting under the specified registry key
Remove-GPRegistryValue @params
This command removes the registry-based policy setting for the registry value HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop ScreenSaveTimeout from the GPO named TestGPO. The registry value is no longer modified when the GPO is applied on a client. Removing a policy setting does not delete the registry value on a client. To delete the registry value when the GPO is applied on a client, you must disable the policy setting by using the Set-GPRegistryValue cmdlet. Source: Microsoft, CC BY 4.0; transcript prompt/output removed. This example was not executed.