Get-GPRegistryValue

Windows Server 2012 R2 and Windows 8.1

Get-GPRegistryValue

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

구문

Parameter Set: GetByGUID
Get-GPRegistryValue -Guid <Guid> -Key <String> [-Domain <String> ] [-Server <String> ] [-ValueName <String> ] [ <CommonParameters>]

Parameter Set: GetByName
Get-GPRegistryValue [-Name] <String> -Key <String> [-Domain <String> ] [-Server <String> ] [-ValueName <String> ] [ <CommonParameters>]




자세한 설명

The Get-GPRegistryValue cmdlet retrieves one or more registry-based policy settings under either Computer Configuration or User Configuration in a GPO.

You can retrieve registry-based policy settings for a specific registry value, or for all the registry values under a key:

-- To retrieve the registry-based policy setting that configures a specific registry value, specify both the Key and the ValueName parameters.

-- To retrieve all the registry-based policy settings that configure values directly under a registry key, specify the Key parameter without the ValueName parameter.

If you specify only a key, in addition to the policy settings that configure values under the key, the following first-level subkeys of the key are returned:

-- first-level subkeys that have a policy setting that configures a value.

-- first-level subkeys that have a subkey (at any level) with a policy setting that configures a value.

You can use this information to browse for registry-based policy settings.

매개 변수

-Domain<String>

Specifies the domain for this cmdlet. You must specify the fully qualified domain name (FQDN) of the domain (for example: sales.contoso.com).

For the Get-GPRegistryValue cmdlet, the GPO for which to retrieve registry-based policy settings 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 Domain by its built-in alias, "domainname". For more information, see about_Aliases.


별칭

domainname

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

true (ByPropertyName)

와일드카드 문자 허용 여부

false

-Guid<Guid>

Specifies the GPO from which to retrieve 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". For more information, see about_Aliases.


별칭

id

필수 여부

true

위치

named

기본값

없음

파이프라인 입력 적용 여부

true (ByPropertyName)

와일드카드 문자 허용 여부

false

-Key<String>

Specifies the registry key for which to retrieve the registry-based policy setting (or settings). For example: "HKLM\Software\Policies\Microsoft\Windows NT\DNSClient".

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.

You can specify:

-- The Key parameter without the ValueName parameter to retrieve all the registry-based policy settings that configure values directly under that key.

-- The Key parameter together with the ValueName parameter to retrieve the registry-based policy setting that configures a specific registry value.

You can also refer to the Key parameter by its built-in alias "FullKeyPath". For more information, see about_Aliases.


별칭

FullKeyPath

필수 여부

true

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Name<String>

Specifies the GPO from which to retrieve 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". For more information, see about_Aliases.


별칭

displayname

필수 여부

true

위치

1

기본값

없음

파이프라인 입력 적용 여부

true (ByValue)

와일드카드 문자 허용 여부

false

-Server<String>

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. For example:

FQDN: DomainController1.SalesDomain.Contoso.com

Host Name: DomainController1

If you do not specify the name by using the Server parameter, the PDC emulator is contacted.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-ValueName<String>

Specifies the name of a registry value for which to retrieve the registry-based policy setting. For example, the registry key "HKLM\Software\Policies\Microsoft\Windows NT\DNSClient" can have a value with the following name: UseDomainNameDevolution. For the default value of a registry key, specify "(default)" or an empty string ("").

You must also specify the Key parameter with this parameter.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 일반 매개 변수 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer 및 -OutVariable을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(http://go.microsoft.com/fwlink/p/?LinkID=113216).

입력

입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.

  • Microsoft.GroupPolicy.Gpo

    A GPO for which to retrieve registry-based policy settings. Collections that contain GPOs from different domains are not supported.


출력

출력 유형은 cmdlet이 내보내는 개체의 유형입니다.

  • Microsoft.GroupPolicy.PolicyRegistrySetting

    Get-GPRegistryValue returns PolicyRegistrySetting objects that represent registry-based policy settings. These objects can be piped into the following cmdlets:

    Set-GPRegistryValue

    Remove-GPRegistryValue


참고

  • The hive of the registry key that you specify (HKLM or HKCU) indicates whether the registry-based policy setting is retrieved from Computer Configuration or User Configuration.

    If the specified registry key cannot be located in policy (the registry key is not configured), a corresponding error message is displayed.

    You can use the Domain parameter to explicitly specify the domain for this cmdlet.

    If you do not explicitly specify the domain, the cmdlet uses a default domain. The default domain is the domain that is used to access network resources by the security context under which the current session is running. This domain is typically the domain of the user that is running the session. For example, the domain of the user who started the session by opening Windows PowerShell® or the domain of a user that is specified in a runas command. However, computer startup and shutdown scripts run under the context of the LocalSystem account. The LocalSystem account is a built-in local account, and it accesses network resources under the context of the computer account. Therefore, when this cmdlet is run from a startup or shutdown script, the default domain is the domain to which the computer is joined.

예제

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

Description

-----------

This command retrieves the registry-based policy setting that configures the registry value "HKEY_CURRENT_USER\Software\Policies\Microsoft\ExampleKey ValueOne" from User Configuration in the "TestGPO" GPO.


PS C:\> Get-GPRegistryValue -Name TestGPO -Key HKCU\Software\Policies\Microsoft\ExampleKey -ValueName ValueOne 

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

Description

-----------

This command retrieves all the registry-based policy settings that configure registry values under the key "HKEY_CURRENT_USER\Software\Policies\Microsoft\ExampleKey" from User Configuration in the "TestGPO" GPO. Subkeys (of this key) that have registry-based policy settings, are also returned. The second registry-based policy setting (ValueTwo) is disabled (its PolicyState property is set to Delete).


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

관련 항목

커뮤니티 추가 항목

추가
표시: