PowerShell Logo Small

Remove-GPPrefRegistryValue



This is the built-in help made by Microsoft for the command 'Remove-GPPrefRegistryValue', 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 preference items from either Computer Configuration or User Configuration in a GPO.

SYNTAX


Remove-GPPrefRegistryValue [[-Server] <String>] [-Domain <String>] [-Order <Int32>] [-ValueName <String>] -Context <GpoConfiguration> -Guid <Guid> -Key <String> [-Confirm]
[-WhatIf] [<CommonParameters>]
Remove-GPPrefRegistryValue [-Name] <String> [[-Server] <String>] [-Domain <String>] [-Order <Int32>] [-ValueName <String>] -Context <GpoConfiguration> -Key <String>
[-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Remove-GPPrefRegistryValue cmdlet removes one or more Registry preference items from either Computer Configuration or User Configuration in a GPO. You must specify the
Context parameter (User or Computer) to indicate whether to remove the Registry preference item from Computer Configuration or User Configuration. . 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, all Registry preference items that configure that registry key or any of its (first-level) values are removed from the specified configuration in the
GPO. Registry preference items that configure subkeys of that key (or their values) are not affected. For a key, specify the Key parameter without the ValueName parameter.

--If you specify a value, all Registry preference items that configure that registry value are removed from the specified configuration in the GPO. 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 preference item from one or more GPOs.

--You can pipe PreferencRegistrySetting objects to this cmdlet to remove one or more Registry preference items from a specified GPO.



<

RELATED LINKS

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

REMARKS

<

Examples


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

C:\PS>Remove-GPPrefRegistryValue -Name TestGPO -Context User -Key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExampleKey" -ValueName ValueOne

DisplayName : TestGPO
DomainName : contoso.com
Owner : CONTOSO\Domain Admins
Id : 92f79f6c-61ce-47d9-8dc6-f78c5cea93ac
GpoStatus : AllSettingsEnabled
Description :
CreationTime : 2/28/2009 5:15:04 PM
ModificationTime : 2/28/2009 5:15:32 PM
UserVersion : AD Version: 5, SysVol Version: 5
ComputerVersion : AD Version: 0, SysVol Version: 0
WmiFilter :



Description

-----------

This command removes all Registry preference items that configure the registry value "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExampleKey ValueOne" from User Configuration in
the "TestGPO" GPO.




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

C:\PS>Remove-GPPrefRegistryValue -Name TestGPO -Context Computer -Key "HKLM\SOFTWARE\Microsoft\ExampleKey"

DisplayName : TestGPO
DomainName : contoso.com
Owner : CONTOSO\Domain Admins
Id : 92f79f6c-61ce-47d9-8dc6-f78c5cea93ac
GpoStatus : AllSettingsEnabled
Description :
CreationTime : 2/28/2009 5:15:04 PM
ModificationTime : 2/28/2009 5:15:32 PM
UserVersion : AD Version: 5, SysVol Version: 5
ComputerVersion : AD Version: 0, SysVol Version: 0
WmiFilter :



Description

-----------

This command removes Registry preference items that configure any (first-level) values under the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExampleKey" or the key
itself from Computer Configuration in the "TestGPO" GPO.




-------------------------- EXAMPLE 3 --------------------------

C:\PS>Get-GPO -All | Remove-GPPrefRegistryValue -Context User -Key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExampleKey" -ValueName ValueOne -ErrorAction SilentlyContinue

DisplayName : TestGPO
DomainName : contoso.com
Owner : CONTOSO\Domain Admins
Id : a83ad1da-9fd4-4005-96b1-7e98042d04de
GpoStatus : AllSettingsEnabled
Description :
CreationTime : 2/28/2009 5:21:05 PM
ModificationTime : 2/28/2009 5:21:17 PM
UserVersion : AD Version: 5, SysVol Version: 5
ComputerVersion : AD Version: 0, SysVol Version: 0
WmiFilter :


DisplayName : TestGPO-1
DomainName : contoso.com
Owner : CONTOSO\Domain Admins
Id : 277eafe8-5dbf-4e3f-86dc-557eee14d0a4
GpoStatus : AllSettingsEnabled
Description :
CreationTime : 2/28/2009 2:35:24 PM
ModificationTime : 2/28/2009 5:21:17 PM
UserVersion : AD Version: 0, SysVol Version: 0
ComputerVersion : AD Version: 0, SysVol Version: 0
WmiFilter :



Description

-----------

This command removes any Registry preference items that configure the registry value "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExampleKey ValueOne" from User Configuration for
all GPOs in the domain. It returns each GPO from which at least one Registry preference item is removed.

Note: The Remove-GPPrefRegistryValue returns a non-terminating error for each GPO that does not have a Registry preference item associated with the specified registry value.
In this command, these error messages are suppressed by setting the ErrorAction parameter to SilentlyContinue (-ErrorAction SilentlyContinue). For more information about the
ErrorAction parameter, see about_CommonParameters.