Edit

Share via


Set-AzureStorSimpleDeviceBackupPolicy

Updates an existing backup policy.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

Default (Default)

Set-AzureStorSimpleDeviceBackupPolicy
    -DeviceName <String>
    -BackupPolicyId <String>
    -BackupPolicyName <String>
    [-BackupSchedulesToAdd <PSObject[]>]
    [-BackupSchedulesToUpdate <PSObject[]>]
    [-BackupScheduleIdsToDelete <PSObject[]>]
    [-VolumeIdsToUpdate <PSObject[]>]
    [-WaitForComplete]
    [-NewName <String>]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

Description

The Set-AzureStorSimpleDeviceBackupPolicy cmdlet updates an existing backup policy. You can rename the policy, add, update or delete schedules, and update the volumes associated with the policy.

Examples

Example 1: Change the name of a backup policy

PS C:\>Set-AzureStorSimpleDeviceBackupPolicy -DeviceName "Contoso63-AppVm" -BackupPolicyId "00001111-aaaa-2222-bbbb-3333cccc4444" -BackupPolicyName "UpdatedGeneralPolicy07" -WaitForComplete
VERBOSE: ClientRequestId: f4465b46-26cc-40ff-88da-7a28df88c35c_PS
VERBOSE: ClientRequestId: 5e33a35c-e089-47c1-b760-474635b1ead8_PS
VERBOSE: About to run a task to update your backuppolicy!
VERBOSE: ClientRequestId: e379ebdb-667f-45a9-aafa-a6cd61e5f6f6_PS


JobId        : 9d621bfd-3faa-4d1c-b28b-45c5f4a96975
JobResult    : Succeeded
JobStatus    : Completed
ErrorCode    :
ErrorMessage :
JobSteps     : {Microsoft.WindowsAzure.Management.StorSimple.Models.TaskStep}

VERBOSE: The job created for your update operation has completed successfully.
VERBOSE: ClientRequestId: 4fe965ea-4e12-4869-9d67-e42a24b6c5d8_PS
BackupSchedules          : {58e9cd7c-4c6a-4e33-9109-5ec0b8fcb2cc, b10e1bf4-ef0a-4ad3-8fde-eecfc9971dd2}
Volumes                  : {testvolume03}
BackupPolicyCreationType : BySaaS
LastBackup               : 12/16/2014 2:13:28 PM
NextBackup               : 12/16/2014 3:13:43 PM
SchedulesCount           : 2
SSMHostName              :
VolumesCount             : 1
InstanceId               : 00001111-aaaa-2222-bbbb-3333cccc4444
Name                     : UpdatedGeneralPolicy07
OperationInProgress      : None

This command changes the name of the backup policy that has the specified ID to UpdatedGeneralPolicy07. This command specifies the WaitForComplete parameter, so the command completes the task, and then returns a TaskStatusInfo object for the task.

Example 2: Update the schedule for a backup policy

PS C:\>$UpdateConfig = New-AzureStorSimpleDeviceBackupScheduleUpdateConfig -Id "3a6c6247-6b4d-42e2-aa87-16f4f21476ea" -BackupType CloudSnapshot -RecurrenceType Daily -RecurrenceValue 3 -RetentionCount 2 -Enabled $True
PS C:\> $UpdateArray = @()
PS C:\> $UpdateArray += $UpdateConfig
PS C:\> Set-AzureStorSimpleDeviceBackupPolicy -DeviceName "Contoso63-AppVm" -BackupPolicyId "00001111-aaaa-2222-bbbb-3333cccc4444" -BackupSchedulesToUpdate $UpdateArray
Error      : Microsoft.WindowsAzure.Management.StorSimple.Models.ErrorDetails
JobId      : 7b265417-a5f1-45ad-8fbc-33bad4f63ec9
JobSteps   : {Microsoft.WindowsAzure.Management.StorSimple.Models.JobStep,
             Microsoft.WindowsAzure.Management.StorSimple.Models.JobStep,
             Microsoft.WindowsAzure.Management.StorSimple.Models.JobStep,
             Microsoft.WindowsAzure.Management.StorSimple.Models.JobStep...}
Result     : Succeeded
Status     : Completed
TaskResult : Succeeded
StatusCode : OK
RequestId  : d2e10d44e699b371a84db44d19daf1c3

The first command creates an update configuration object by using the New-AzureStorSimpleDeviceBackupScheduleUpdateConfig cmdlet, and then stores it in the $UpdateConfig variable.

The second command creates a new array variable, named $UpdateArray. The next command adds the update stored in $UpdateConfig to that array. You can add more than one update to the array.

The final command updates the backup policy that has the specified ID on the device named Contoso63-AppVm. The policy now has the updated schedule stored in $UpdateArray.

Parameters

-BackupPolicyId

Specifies the instance ID of the BackupPolicy object to update.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-BackupPolicyName

Specifies a new name for the backup policy.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-BackupScheduleIdsToDelete

Specifies an array of instance IDs of BackupSchedule objects to delete.

Parameter properties

Type:

PSObject[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-BackupSchedulesToAdd

Specifies an array of BackupScheduleBase objects to add to the policy. To obtain a BackupScheduleBase object, use the New-AzureStorSimpleDeviceBackupScheduleAddConfig cmdlet.

Parameter properties

Type:

PSObject[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-BackupSchedulesToUpdate

Specifies an array of BackupScheduleUpdateRequest objects to update. To obtain a BackupScheduleUpdateRequest object, use the New-AzureStorSimpleDeviceBackupScheduleUpdateConfig cmdlet.

Parameter properties

Type:

PSObject[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-DeviceName

Specifies the name of the StorSimple device for which to update the backup policy.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-NewName

Specifies a name for the device.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-Profile

Specifies an Azure profile.

Parameter properties

Type:AzureSMProfile
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-VolumeIdsToUpdate

Specifies an array of IDs of volumes for which to update backup policies.

Parameter properties

Type:

PSObject[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-WaitForComplete

Indicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell console.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

TaskStatusInfo, TaskResponse

This cmdlet returns a TaskStatusInfo object if you specify the WaitForComplete parameter. If you do not specify that parameter, it returns a TaskResponse object.