PowerShell Logo Small

Get-GPPrefRegistryValue



This is the built-in help made by Microsoft for the command 'Get-GPPrefRegistryValue', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 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

Retrieves one or more Registry preference items under either Computer Configuration or User Configuration in a GPO.

SYNTAX


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



Search powershellhelp.space

DESCRIPTION


The Get-GPPrefRegistryValue cmdlet retrieves one or more Registry preference items under either Computer Configuration or User Configuration
in a GPO. You must specify the Context parameter (User or Computer) to indicate whether to retrieve 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 retrieve Registry preference items for a specific registry value, or for a key and any of its first-level registry values:

-- To retrieve any Registry preference items that configure a specific registry value, specify both the Key and the ValueName parameters.

-- To retrieve all the Registry preference items that configure a registry key and any (first-level) registry values directly under the key,
specify the Key parameter without the ValueName parameter.


If you specify only a key, the cmdlet also returns its first-level subkeys for which there are Registry preference items that configure the
subkey, its values, or any of its subkeys (at any level) or their values. You can use this information to browse for Registry preference items.



<

RELATED LINKS

Remove-GPPrefRegistryValue
Set-GPPrefRegistryValue

REMARKS

<

Examples


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

C:\PS>get-gpprefregistryvalue -name testgpo -context user -key hklm\software\microsoft\examplekey -valuename valueone

KeyPath : SOFTWARE\Microsoft\ExampleKey
FullKeyPath : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExampleKey
Hive : LocalMachine
Action : Create
Order : 1
DisabledDirectly : False
DisabledByAncestor : False
Value : NewData1
Type : String
ValueName : ValueOne
HasValue : True



Description

-----------

This command retrieves the Registry preference item that is configured for the registry value
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExampleKey ValueOne" from User Configuration in the "TestGPO" GPO.




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

C:\PS>get-gpprefregistryvalue -name testgpo -context user -key hklm\software\microsoft\examplekey

KeyPath : SOFTWARE\Microsoft\ExampleKey
FullKeyPath : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExampleKey
Hive : LocalMachine
Action : Create
Order : 1
DisabledDirectly : False
DisabledByAncestor : False
Value : NewData1
Type : String
ValueName : ValueOne
HasValue : True

KeyPath : SOFTWARE\Microsoft\ExampleKey
FullKeyPath : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExampleKey
Hive : LocalMachine
Action : Create
Order : 2
DisabledDirectly : False
DisabledByAncestor : False
Value : NewData2
Type : String
ValueName : Valuetwo
HasValue : True



KeyPath : SOFTWARE\Microsoft\ExampleKey\Subkey1
FullKeyPath : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExampleKey\Subkey1
Hive : LocalMachine

KeyPath : SOFTWARE\Microsoft\ExampleKey\SubKey2
FullKeyPath : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExampleKey\SubKey2
Hive : LocalMachine



Description

-----------

This command retrieves all the Registry preference items that are configured for the registry key
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExampleKey" and any of its first-level values from User Configuration in the "TestGPO" GPO.

In this example, Registry preference items that configure the following two first-level values of the registry key are returned: ValueOne and
ValueTwo. Two subkeys of the key are also returned. This is because there are Registry preference items in User Configuration associated with
each subkey.