New-GPO

New-GPO

Creates a new GPO.

구문

Parameter Set: New
New-GPO [-Name] <String> [-Comment <String> ] [-Domain <String> ] [-Server <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: NewStarterGUID
New-GPO [-Name] <String> -StarterGpoGuid <Guid> [-Comment <String> ] [-Domain <String> ] [-Server <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: NewStarterName
New-GPO [-Name] <String> -StarterGpoName <String> [-Comment <String> ] [-Domain <String> ] [-Server <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

자세한 설명

The New-GPO cmdlet creates a new GPO with a specified name. By default, the newly created GPO is not linked to a site, domain, or organizational unit (OU).

You can use this cmdlet to create a GPO that is based on a starter GPO by specifying the GUID or the display name of the Starter GPO, or by piping a StarterGpo object into the cmdlet.

The cmdlet returns a GPO object, which represents the newly created GPO, that you can pipe to other Group Policy cmdlets.

매개 변수

-Comment<String>

Includes a comment for the new GPO. The comment string must be enclosed in double- or single-quotation marks and can contain 2,047 characters.

Use the comment to document the GPO and its implementation in your environment. Or, if you insert keywords in the comment, you can use the keyword filter to find GPOs that have matching keywords.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Domain<String>

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

For the New-GPO cmdlet:

-- The new GPO is created in this domain.

-- If a Starter GPO is specified, it must exist in this domain.

If you do not specify the Domain parameter, then the domain of the user 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 running the current session (or the computer for a startup or shutdown script), then a trust must exist between that domain and the domain of the user (or computer).

You can also refer to Domain by its built-in alias, "domainname". For more information, see about_Aliases.

별칭

없음

필수 여부

false

위치

named

기본값

Current domain

파이프라인 입력 적용 여부

true (ByPropertyName)

와일드카드 문자 허용 여부

false

-Name<String>

Assigns a display name to the new GPO.

If another GPO with the same display name exists in the domain an error occurs.

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

별칭

없음

필수 여부

true

위치

1

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

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.

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

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-StarterGpoGuid<Guid>

Specifies a Starter GPO by its globally unique identifier (GUID). The GUID uniquely identifies the Starter GPO. If a Starter GPO is specified, the GPO is created with its settings.

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

별칭

없음

필수 여부

true

위치

named

기본값

없음

파이프라인 입력 적용 여부

true (ByPropertyName)

와일드카드 문자 허용 여부

false

-StarterGpoName<String>

Specifies a Starter GPO by its display name. The name can contain 255 characters. If the name includes blank characters, enclose the name in double-quotation marks or single-quotation marks. If a Starter GPO is specified, the GPO is created with its settings.

The display name is not guaranteed to be unique in the domain. If another Starter GPO with the same display name exists in the domain, an error occurs. You can use the StarterGpoGuid parameter to uniquely identify a Starter GPO.

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

별칭

없음

필수 여부

true

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Confirm

cmdlet을 실행하기 전에 확인 메시지가 표시됩니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-WhatIf

cmdlet이 실행될 경우 결과 동작을 표시합니다. cmdlet이 실행되지 않습니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

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

입력

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

  • Microsoft.GroupPolicy.StarterGpo

    A Starter GPO that has predefined settings.

출력

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

  • Microsoft.GroupPolicy.Gpo

    New-GPO returns the GPO that was created.

참고

  • Only domain administrators, enterprise administrators, and members of the Group Policy creator owners group can create GPOs. These users must run Windows PowerShell in an elevated state.

    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 from the Program Files menu, 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 creates a GPO in the domain of the user. The GPO is created with the specified comment.

PS C:\> New-GPO -Name TestGPO -comment "This is a test GPO." 

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

Description

-----------

This command creates a GPO in the domain of the user. The GPO is pre-populated with the settings of the Starter GPO.

PS C:\> New-GPO -Name FromStarterGPO -StarterGPOName "Windows Vista EC Computer Starter GPO"

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

Description

-----------

This command creates a new GPO ("TestGPO"), links it to the "Marketing" OU in the contoso.com domain, and grants the "Marketing Admins" security group permissions to edit the GPO.

A GPO object is returned by the command, so you could continue to configure the new GPO by piping the output to other cmdlets. For example, you could set Registry preference items or registry-based policy settings by piping the output to Set-GPPrefRegistryValue or to Set-GPRegistryValue.

PS C:\> new-gpo -name TestGPO | new-gplink -target "ou=marketing,dc=contoso,dc=com" | set-gppermissions -permissionlevel gpoedit -targetname "Marketing Admins" -targettype group