New-OBRetentionPolicy

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

Syntax

New-OBRetentionPolicy
   [[-RetentionDays] <Long {7 | 15 | 30}>]
   [[-RetentionWeeklyPolicy]]
   [[-WeekDaysOfWeek] {Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday}]
   [[-WeekTimesOfDay] <List[timespan]>]
   [[-RetentionWeeks] <long>]
   [[-RetentionMonthlyPolicy]]
   [<CommonParameters>]

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.

Type:Long {7 | 15 | 30}
Position:2
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

Microsoft.Internal.CloudBackup.Commands.OBRetentionPolicy

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