Backup-GPO

Backup-GPO

Backs up one GPO or all the GPOs in a domain.

구문

Parameter Set: BackupOne(GUID)
Backup-GPO -Guid <Guid> -Path <String> [-Comment <String> ] [-Domain <String> ] [-Server <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: BackupAll
Backup-GPO -Path <String> [-All] [-Comment <String> ] [-Domain <String> ] [-Server <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: BackupOne(Name)
Backup-GPO [-Name] <String> -Path <String> [-Comment <String> ] [-Domain <String> ] [-Server <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

자세한 설명

The Backup-GPO cmdlet backs up a specified GPO or all the GPOs in a domain to a backup directory. The backup directory and GPO must already exist.

매개 변수

-All

Specifies that all the GPOs in the domain are backed up.

별칭

없음

필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Comment<String>

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

별칭

없음

필수 여부

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: sales.contoso.com).

For the Backup-GPO cmdlet, the GPO to back up 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.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

true (ByPropertyName)

와일드카드 문자 허용 여부

false

-Guid<Guid>

Specifies the GPO to backup 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.

별칭

없음

필수 여부

true

위치

named

기본값

없음

파이프라인 입력 적용 여부

true (ByPropertyName)

와일드카드 문자 허용 여부

false

-Name<String>

Specifies the GPO to backup 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.

별칭

없음

필수 여부

true

위치

1

기본값

없음

파이프라인 입력 적용 여부

true (ByValue)

와일드카드 문자 허용 여부

false

-Path<String>

Specifies the path to the backup directory; for example, "C:\Backups" or "\\MyServer\Backups".

별칭

없음

필수 여부

true

위치

named

기본값

없음

파이프라인 입력 적용 여부

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.

별칭

없음

필수 여부

false

위치

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.Gpo

    A GPO to be backed up. Collections that contain GPOs from different domains are not supported.

출력

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

  • Microsoft.GroupPolicy.GpoBackup

    Backup-GPO returns an object that represents the file that holds the settings of the backed-up GPO.

참고

  • 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 backs up the "TestGPO" GPO to the C:\GpoBackups directory. The specified comment is included in the GPO backup.

PS C:\> Backup-Gpo -Name TestGPO -Path C:\GpoBackups -Comment "Weekly Backup" 

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

Description

-----------

This command backs up the GPO with the specified GUID in the contoso.com domain to the \\Server1\GpoBackups directory. The domain controller at DC1.contoso.com is contacted to complete the operation.

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

PS C:\> Backup-Gpo -GUID fa4a9473-6e2a-4b87-ab78-175e68d97bde -Domain contoso.com -Server DC1 -Path \\Server1\GpoBackups

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

Description

-----------

This command backs up all the GPOs in the domain of the user that is running the session (or, for startup and shutdown scripts, the computer) to the \\Server1\GpoBackups directory.

PS C:\> Backup-Gpo -All -Path \\Server1\GpoBackups

관련 항목

Import-GPO

Restore-GPO