다음을 통해 공유


Set-OBPolicy

Sets the OBPolicy object as the backup policy that will be used for scheduled backups.

구문

Default (기본값)

Set-OBPolicy
    [-Policy] <CBPolicy>
    [-Confirm]
    [-WhatIf]

Description

The Set-OBPolicy cmdlet sets the specified OBPolicy object as the backup policy that will be used for scheduled backups.

This cmdlet supports the WhatIf and the Confirm parameters. The cmdlet prompts the user for confirmation by default. The WhatIf parameter gives a verbose description of what the cmdlet does without performing any operation. The Confirm parameter specifies whether the cmdlet should prompt the user. Specify -Confirm:$FALSE to override the prompt.

To use Microsoft Azure Backup cmdlets, the user needs to be an administrator on the protected machine.

예제

EXAMPLE 1

$fspec = New-OBFileSpec -FileSpec C:\test\texttext1.txt



$rpolicy = New-OBRetentionPolicy



$sch = New-OBSchedule



New-OBPolicy | Add-OBFileSpec -FileSPec $fspec | Set-OBRetentionPolicy -RetentionPolicy $rpolicy | Set-OBSchedule -Schedule $sch | Set-OBPolicy

This example sets a new Microsoft Azure Backup policy for a server.

매개 변수

-Confirm

Prompts you for confirmation before running the cmdlet.

매개 변수 속성

형식:SwitchParameter
Default value:False
와일드카드 지원:False
DontShow:False

매개 변수 집합

(All)
Position:Named
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

-Policy

Specifies the current OBPolicy object be set as the active backup policy for the server.

매개 변수 속성

형식:CBPolicy
Default value:None
와일드카드 지원:False
DontShow:False

매개 변수 집합

(All)
Position:2
필수:True
파이프라인의 값:True
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

매개 변수 속성

형식:SwitchParameter
Default value:False
와일드카드 지원:False
DontShow:False

매개 변수 집합

(All)
Position:Named
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

입력

Microsoft.Internal.CloudBackup.Commands.OBPolicy

출력

Microsoft.Internal.CloudBackup.Commands.OBPolicy

This cmdlet sets the OBPolicy object as the backup policy to use for scheduled backups.