PowerShell Logo Small

Remove-GPRegistryValue



This is the built-in help made by Microsoft for the command 'Remove-GPRegistryValue', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Removes one or more registry-based policy settings from either Computer Configuration or User Configuration in a GPO.

SYNTAX


Remove-GPRegistryValue [-Guid] <Guid> [-Key] <String> [[-ValueName] <String>] [[-Domain] <String>] [[-Server] <String>] [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-GPRegistryValue [-Name] <String> [-Key] <String> [[-ValueName] <String>] [[-Domain] <String>] [[-Server] <String>] [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Remove-GPRegistryValue cmdlet removes one or more registry-based policy settings from either Computer Configuration or User Configuration in a GPO. You can specify the
GPO by its display name or by its GUID.


You can specify either a key or a value:

--If you specify a key, registry-based policy settings that configure any of its (first-level) values are removed. However, if there are registry-based policy settings that
configure any subkeys or their values, an error occurs and no policy settings are removed (including those for first-level values of the key). For a key, specify the Key
parameter without the ValueName parameter.

--If you specify a value, the registry-based policy setting that configures that registry value is removed. For a value, specify the Key parameter without the ValueName
parameter.


This cmdlet can take input from the pipeline:

--You can pipe GPO objects to this cmdlet to remove a specified registry-based policy setting from one or more GPOs.

--You can pipe PolicyRegistrySetting objects to this cmdlet to remove one or more registry-based policy settings from a specified GPO.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?linkid=287730
Get-GPRegistryValue
Set-GPRegistryValue

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

C:\PS>Remove-GPRegistryValue -Name "TestGPO" -key "HKCU\Software\Policies\Microsoft\Windows\Control Panel\Desktop" -ValueName ScreenSaveTimeOut

DisplayName : TestGPO
DomainName : contoso.com
Owner : CONTOSO\Domain Admins
Id : 35c12ab3-956c-45d5-973b-46b17d225f47
GpoStatus : AllSettingsEnabled
Description :
CreationTime : 2/24/2009 4:41:03 PM
ModificationTime : 2/25/2009 12:45:52 PM
UserVersion : AD Version: 4, SysVol Version: 4
ComputerVersion : AD Version: 34, SysVol Version: 34
WmiFilter :



Description

-----------

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 "TestGPO" GPO. 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.




-------------------------- EXAMPLE 2 --------------------------

C:\PS>Remove-GPRegistryValue -Name TestGPO -Key HKCU\Software\Policies\Microsoft\ExampleKey



Description

-----------

This command removes all the registry-based policy settings that configure (first-level) registry values under the key
"HKEY_CURRENT_USER\Software\Policies\Microsoft\ExampleKey" from User Configuration in the "TestGPO" GPO. If there are registry-based policy settings in User Configuration
that configure registry values for any subkeys of this key, an error occurs and no (first-level) policy settings are removed.