Share via


New-OBRetentionPolicy

Creates a new OBRetentionPolicy specifying the number of days that the backup needs to be retained.

Syntax

Default (Default)

New-OBRetentionPolicy
    [[-RetentionDays] <<Long>]
    [-RetentionWeeklyPolicy]
    [-WeekDaysOfWeek]
    [[-WeekTimesOfDay] <List[timespan]>]
    [[-RetentionWeeks] <long>]
    [-RetentionMonthlyPolicy]

Description

The New-OBRetentionPolicy creates a new OBRetentionPolicy object specifying the number of days to retain the backed up items.

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

Examples

EXAMPLE 1

 New-OBRetentionPolicy -RetentionDays 30

This example creates a new retention policy.

Parameters

-RetentionDays

Specifies the number of days to retain the backup data. Retention days must be specified as either 7, 15, or 30. Other integers are not supported.

Parameter properties

Type:Long {7 | 15 | 30}
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

Inputs

None

Outputs

Microsoft.Internal.CloudBackup.Commands.OBRetentionPolicy

Specifies the number of days that the backup needs to be retained.