Set-WBPolicy

Windows Server 2012 R2 and Windows 8.1

Set-WBPolicy

Sets the backup policy for scheduled backups.

구문

Parameter Set: Default
Set-WBPolicy [-Policy] <WBPolicy> [[-AllowDeleteOldBackups]] [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]




자세한 설명

The Set-WBPolicy cmdlet sets a WBPolicy object as the backup policy for scheduled backups.

To use this cmdlet, you must be a member of the Administrators group or Backup Operators group.

매개 변수

-AllowDeleteOldBackups

Indicates whether new backups can overwrite older backups.


별칭

없음

필수 여부

false

위치

3

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Force

Sets the policy without prompting you for confirmation. By default, the cmdlet prompts you for confirmation before it proceeds.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Policy<WBPolicy>

Specifies a WBPolicy object that contains that contains a backup policy to update.


별칭

없음

필수 여부

true

위치

1

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

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(http://go.microsoft.com/fwlink/p/?LinkID=113216).

입력

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

  • WBPolicy

    The Set-WBPolicy cmdlet sets a WBPolicy object as the current backup policy to use for scheduled backups.


출력

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

  • None

    None


참고

  • The WBPolicy object must be in edit mode. To put the WBPolicy object in edit mode for a policy that is set as the scheduled backup policy, use the Get-WBPolicy cmdlet with the Editable parameter. The New-WBPolicy cmdlet creates a WBPolicy object in edit mode.

예제

Example 1: Set a backup policy

This example sets a new backup policy.


 

The first command creates a backup policy object and stores it in the $Policy variable.


PS C:\> $Policy = New-WBPolicy

 

The second command creates a file specification object and stores the result in the $FileSpec variable. A file specification determines what items to include or exclude from backups.


PS C:\> $FileSpec = New-WBFileSpec -FileSpec C:\dir1

 

The third command adds a Windows Backup file specification to the backup policy.


PS C:\> Add-WBFileSpec -Policy $Policy -FileSpec $FileSpec

 

The fourth command adds bare metal recovery to the policy.


PS C:\> Add-WBBareMetalRecovery $Policy

 

The fifth command gets the Windows Backup disk configuration. This cmdlet gets the list of internal and external disks available for the local computer and stores the resulting list in the $Disks variable.


PS C:\> $Disks = Get-WBDisk

 

The sixth command creates a backup target object and stores it in the $BackupLocation variable.


PS C:\> $BackupLocation = New-WBBackupTarget -Disk $Disks[2]

 

The seventh command adds a backup target. The $BackupLocation variable specifies the backup locations in the policy.


PS C:\> Add-WBBackupTarget -Editable -Policy $Policy -Target $BackupLocation 

 

The eighth command sets the backup schedule in the policy. The cmdlet sets the times to create daily backups.


PS C:\> Set-WBSchedule -Policy $Policy 09:00

 

The ninth command sets the backup policy object for the computer.


PS C:\> Set-WBPolicy -Policy $Policy 

Example 2: Set backup policy by using a remote shared file

This example modifies the backup policy for the set WBPolicy object and changes the backup location to a remote file share.


 

The first command gets the backup policy object and stores it in the $Policy variable.


PS C:\> $Policy = Get-WBPolicy -Editable

 

The second command creates a backup target object and stores it in the $BackupLocation variable. When you are prompted, specify the credentials to access the remote shared folder and acknowledge the warning about choosing a remote shared folder as a backup storage location.


PS C:\> $BackupLocation = New-WBBackupTarget -NetworkPath \\ContosoSrv\ContosoShared

 

The third command adds a backup target to the policy. The target is the $BackupLocation variable.


PS C:\> Add-WBBackupTarget -Policy $policy -Target $BackupLocation 

 

The fourth command sets backup policy object from the changes to the $Policy variable.


PS C:\> Set-WBPolicy -Policy $Policy

관련 항목

커뮤니티 추가 항목

추가
표시: