Gets one or more Registry preference items under either Computer Configuration or User Configuration in a GPO.
Active Directory · Risk: Low · Documentation Verified
Last verified: 2026-10-26
Microsoft GroupPolicy reference: Gets one or more Registry preference items under 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 Get-GPPrefRegistryValue. 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
-Context (required)
Specifies whether the cmdlet gets the Registry preference item from User Configuration or Computer Configuration in the GPO. The acceptable values for this parameter are: User or Computer.
-Domain
Specifies the domain for this cmdlet. You must specify the fully qualified domain name (FQDN) of the domain. For the Get-GPPrefRegistryValue cmdlet, the GPO for which to get the Registry preference item 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 this cmdlet gets the Registry preference item 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. For more information, see about_Aliases.
-Key (required)
Specifies the registry key for the Registry preference item that this cmdlet gets; for instance: HKEY_CURRENT_USER\Control Panel\Colors. The acceptable values for this parameter are: - HKEY_CLASSES_ROOT (HKCR) - HKEY_CURRENT_USER (HKCU) - HKEY_LOCAL_MACHINE (HKLM) - HKEY_USERS (HKU) - HKEY_CURRENT_CONFIG (HKCC) Any of these hives can be specified for Registry preference items in both Computer Configuration and User Configuration. The Key parameter can be specified with or without the *ValueName* parameter: - If the ValueName parameter is specified, all Registry preference items that configure the registry value are retrieved. - If the ValueName parameter is not specified, all Registry preference items that configure the registry key and any of its first-level values are retrieved. You can also refer to the Key parameter by its built-in alias, FullKeyPath. For more information, see about_Aliases.
-Name (required)
Specifies the GPO from which this cmdlet gets the Registry preference item 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. For more information, see about_Aliases.
-Order
Specifies the order in which the Registry preference item is applied, relative to the other Registry preference items in the GPO, on a client.
-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 through 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. For more information, see about_Aliases.
-ValueName
Specifies the name of a registry value for which this cmdlet gets all Registry preference items. For instance, the registry key HKEY_CURRENT_USER\Control Panel\Colors can have a value with the following name: ActiveTitle. For the default value of a registry key, specify either "(default)" or an empty string (""). When you want to gets Registry preference items for a registry key and all its first-level values, do not specify this parameter. When you want to get Registry preference items only for a specific registry value, specify this parameter together with the Key parameter.
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 is a read-oriented cmdlet; protect any sensitive results and check the documented effects of your selected parameters.
Examples
Example 1: Get the Registry preference item value
Get-GPPrefRegistryValue @params
This command gets the Registry preference item that is configured for the registry value HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExampleKey with value name ValueOne from User Configuration in the GPO named TestGPO. Source: Microsoft, CC BY 4.0; transcript prompt/output removed. This example was not executed.