azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

I can't change a VM backup schedule

Open IvanovOleg opened this issue 9 years ago • 4 comments

Hi,

I am trying to automate a VM backup configuration and have to change a backup schedule.

$schedulePolicy = Get-AzureRmRecoveryServicesBackupSchedulePolicyObject -WorkloadType "AzureVM"
$schedulePolicy.ScheduleRunTimes.RemoveAll()

The RemoveAll() method returns something like Impossible to find an overload for "RemoveAll" and quantity of arguments: "0". So I can't delete a default schedule.

IvanovOleg avatar Jan 04 '17 19:01 IvanovOleg

I was able to delete a default schedule this way: $schedulePolicy.ScheduleRunTimes.Remove($schedulePolicy.ScheduleRunTimes[0])

IvanovOleg avatar Jan 04 '17 19:01 IvanovOleg

@dragonfly91 @pragrawa @mkherani can you take a look, and assign to the appropriate milestone if you decide to fix?

markcowl avatar Jan 17 '17 23:01 markcowl

Hi

Did you find a solution to your problem?

kind regards

Asger

asgerls avatar Jun 06 '17 12:06 asgerls

@IvanovOleg please use $schedulePolicy.ScheduleRunTimes.Clear() to delete default schedule.

pragrawa avatar Nov 07 '17 18:11 pragrawa