Get-GPPermission

Windows Server 2012 R2 and Windows 8.1

Get-GPPermission

Gets the permission level for one or more security principals on a specified GPO.

별칭

다음 약어는 이 cmdlet의 별칭입니다.

  • Get-GPPermissions

구문

Parameter Set: SourcebyGUID
Get-GPPermission -Guid <Guid> [-All] [-DomainName <String> ] [-Server <String> ] [-TargetName <String> ] [-TargetType <PermissionTrusteeType> ] [ <CommonParameters>]

Parameter Set: SourcebyName
Get-GPPermission [-Name] <String> [-All] [-DomainName <String> ] [-Server <String> ] [-TargetName <String> ] [-TargetType <PermissionTrusteeType> ] [ <CommonParameters>]




자세한 설명

Gets the permission level for one or more security principals on the specified GPO. You can use the TargetName and TargetType parameters to specify a user, security group, or computer for which to retrieve the permission level. You can use the All parameter to retrieve the permission level for each security principal (user, security group, or computer) that has permissions on the GPO. You can specify the GPO by its display name or by its GUID.

매개 변수

-All

Gets the permission level for each user, group, or computer that has permissions on the GPO.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-DomainName<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-GPPermission cmdlet, the GPO for which to get the permission level 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 Server parameter by its built-in alias, "domain". For more information, see about_Aliases.


별칭

domain

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

true (ByPropertyName)

와일드카드 문자 허용 여부

false

-Guid<Guid>

Specifies the GPO from which to retrieve the permission level 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

-Name<String>

Specifies the GPO from which to retrieve the permission level 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.sales.contoso.com

Host Name: DomainController1

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

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


별칭

dc

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-TargetName<String>

The name of the security principal for which to retrieve the permission level. You can specify a user, a security group, or a computer. You can use either the domain-qualified name of the security principal (domain\account) or just its name.

For example, in the contoso.com domain, to specify:

-- The user "someuser", use "contoso\someuser" or "someuser".

-- The Domain Admins security group, use "contoso\Domain Admins" or "Domain Admins".

-- The computer "computer-01", use "contoso\computer-01" or "computer-01".


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-TargetType<PermissionTrusteeType>

The type of security principal for which to retrieve the permission level. You must specify Computer, User, or Group.

The following values are permitted for this object type.

-- Computer

-- User

-- Group


별칭

없음

필수 여부

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 the permission level. Collections that contain GPOs from different domains are not supported.


출력

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

  • Get-GPPermission returns an object that represents permissions for the specified security principal (user, group, or computer) on the GPO.


참고

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

    If you do not explicitly specify the domain, the cmdlet uses the 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 gets the permission level for the "Domain Users" group on the GPO named TestGpo.


PS C:\> Get-GPPermission -Name TestGpo -TargetName "Domain Users" -TargetType Group 

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

Description

-----------

This command gets the permission level for the "Domain Admins" group on the GPO with the GUID fa4a9473-6e2a-4b78-175e68d97bde in the Sales.Contoso.com domain. The DC1.sales.contoso.com domain controller is contacted to complete the operation.

If the domain of the user that is running the session (or, for startup and shutdown scripts, the computer) is different from the sales.contoso.com domain, a trust must exist between the two domains, or the command fails.


PS C:\> Get-GPPermission -Domain sales.contoso.com -Server DC1 -GUID fa4a9473-6e2a-4b87-ab78-175e68d97bde -TargetName "Domain Admins" -TargetType Group

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

Description

-----------

This command gets the permission level for each security principal that has permissions on the GPO.


PS C:\> Get-GPPermission -Name TestGPO -All 

-------------------------- EXAMPLE 4 --------------------------

Description

-----------

This command lists the display name of each GPO (in the domain) on which the specified security principal has permissions.

First, Get-GPO is used to retrieve all the GPOs in the domain (Get-GPO -All). Then, the collection is piped into the foreach-object command. As each GPO is evaluated, it is piped into Get-GPPermissions. If a permission level is returned, the DisplayName property of the GPO is printed ($_.DisplayName).

Note: The ErrorAction parameter is set to SilentlyContinue for Get-GPPermissions. This is because a non-terminating error occurs if the specified security principal does not have permissions on the GPO. Specifying the ErrorAction as SilentlyContinue prevents the error messages from being printed for GPOS on which the security principal does not have permissions. For more information about the ErrorAction parameter, see about_CommonParameters.


PS C:\> Get-GPO -All | foreach-object { if($_ | Get-GPPermission -TargetName "contoso\Domain Admins" -TargetType Group -ErrorAction SilentlyContinue) {$_.DisplayName}} 

관련 항목

커뮤니티 추가 항목

추가
표시: