< Back

New-AzureRmRecoveryServicesAsrPolicy

Tue Jan 29, 2019 10:01 pm

NAME New-AzureRmRecoveryServicesAsrPolicy



SYNOPSIS

Creates an Azure Site Recovery replication policy.





SYNTAX

New-AzureRmRecoveryServicesAsrPolicy [[-VmmToVmm]] [-ApplicationConsistentSnapshotFrequencyInHours <Int32>] [-Authentication {Certificate |

Kerberos}] [-Compression {Enable | Disable}] [-Confirm] [-DefaultProfile <IAzureContextContainer>] -Name <String> [-NumberOfRecoveryPointsToRetain

<Int32>] [-ReplicaDeletion {Required | NotRequired}] -ReplicationFrequencyInSeconds {30 | 300 | 900} [-ReplicationMethod {Online | Offline}]

-ReplicationPort <UInt16> -ReplicationProvider {HyperVReplica2012R2 | HyperVReplica2012 | HyperVReplicaAzure} [-ReplicationStartTime <TimeSpan>]

[-WhatIf] [<CommonParameters>]



New-AzureRmRecoveryServicesAsrPolicy [-ApplicationConsistentSnapshotFrequencyInHours <Int32>] -AzureToAzure [-Confirm] [-DefaultProfile

<IAzureContextContainer>] [-MultiVmSyncStatus {Enable | Disable}] -Name <String> -RecoveryPointRetentionInHours <Int32> [-WhatIf]

[<CommonParameters>]



New-AzureRmRecoveryServicesAsrPolicy [-AzureToVMware] [-ApplicationConsistentSnapshotFrequencyInHours <Int32>] [-Confirm] [-DefaultProfile

<IAzureContextContainer>] [-MultiVmSyncStatus {Enable | Disable}] -Name <String> -RPOWarningThresholdInMinutes <Int32>

-RecoveryPointRetentionInHours <Int32> [-WhatIf] [<CommonParameters>]



New-AzureRmRecoveryServicesAsrPolicy [[-HyperVToAzure]] [-ApplicationConsistentSnapshotFrequencyInHours <Int32>] [-Confirm] [-DefaultProfile

<IAzureContextContainer>] [-Encryption {Enable | Disable}] -Name <String> [-NumberOfRecoveryPointsToRetain <Int32>]

[-RecoveryAzureStorageAccountId <String>] -ReplicationFrequencyInSeconds {30 | 300 | 900} -ReplicationProvider {HyperVReplica2012R2 |

HyperVReplica2012 | HyperVReplicaAzure} [-ReplicationStartTime <TimeSpan>] [-WhatIf] [<CommonParameters>]



New-AzureRmRecoveryServicesAsrPolicy [-VMwareToAzure] [-ApplicationConsistentSnapshotFrequencyInHours <Int32>] [-Confirm] [-DefaultProfile

<IAzureContextContainer>] [-MultiVmSyncStatus {Enable | Disable}] -Name <String> -RPOWarningThresholdInMinutes <Int32>

-RecoveryPointRetentionInHours <Int32> [-WhatIf] [<CommonParameters>]





DESCRIPTION

The New-AzureRmRecoveryServicesAsrPolicy cmdlet creates an Azure Site Recovery replication policy. The replication policy is used to specify

replication settings such as the replication frequency and number of recovery points.





PARAMETERS

-ApplicationConsistentSnapshotFrequencyInHours <Int32>

Specifies the frequency(in hours) at which to create application consistent recovery points.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Authentication <String>

Specifies the type of authentication used. Valid values are:



- Certificate



- Kerberos



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AzureToAzure [<SwitchParameter>]

Switch parameter specifying that the replication policy being created will be used to replicated Azure virtual machines between two Azure

regions.



Required? true

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-AzureToVMware [<SwitchParameter>]

Switch parameter specifying that the replication policy being created will be used to reverse replicate failed over VMware virtual machines

and Physical servers running in Azure back to an on-premises VMware site.



Required? true

Position? 0

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Compression <String>

Specifies if compression should be enabled.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with Azure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Encryption <String>

Specifies if encryption should be enabled or disabled.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-HyperVToAzure [<SwitchParameter>]

Switch parameter to specify policy is to be used to replicate Hyper-V virtual machines to Azure



Required? false

Position? 0

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-MultiVmSyncStatus <String>

Specifies multiVm sync status for the policy.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies the name of the ASR replication policy.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-NumberOfRecoveryPointsToRetain <Int32>

Specifies the number recovery points to retain.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-RPOWarningThresholdInMinutes <Int32>

The RPO threshold value in minutes to warn on.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-RecoveryAzureStorageAccountId <String>

Specifies the ID of the Azure storage account to replicate to.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-RecoveryPointRetentionInHours <Int32>

Retain the recovery points for given time in hours.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ReplicaDeletion <String>

Specifies if the replica virtual machine should be deleted on disabling replication from a VMM managed site to another.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ReplicationFrequencyInSeconds <String>

Specifies the replication frequency interval in seconds. Valid values are:



- 30



- 300



- 900



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ReplicationMethod <String>

Specifies the replication method. Valid values are:



- Online



- Offline



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ReplicationPort <UInt16>

Specifies the port used for replication.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ReplicationProvider <String>

Specifies the replication provider for the policy.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ReplicationStartTime <TimeSpan>

Specifies the replication start time. It must be no later than 24-hours from the start of the job.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-VMwareToAzure [<SwitchParameter>]

Switch parameter specifying that the replication policy being created will be used to replicate VMware virtual machines and/or Physical

servers to Azure.



Required? true

Position? 0

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-VmmToVmm [<SwitchParameter>]

Switch parameter to specify policy is to be used to replicate between Hyper-V sites managed by a VMM server.



Required? false

Position? 0

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None







OUTPUTS

System.Object







NOTES









Example 1



PS C:\\> New-AzureRmRecoveryServicesAsrPolicy -Name "abc" -ReplicationProvider HyperVReplicaAzure -ReplicationFrequencyInSeconds 30

-NumberOfRecoveryPointsToRetain 10



Starts the replication policy creation operation using the specified parameters and returns the ASR job used to track the operation.





Example 2



PS C:\\> New-AzureRmRecoveryServicesAsrPolicy -Name "abc122" -ReplicationProvider HyperVReplica2012R2 -ReplicationFrequencyInSeconds 300

-ReplicationPort 211



Name : 1c609a5b-324e-461c-866f-ad58f944df25

ID : /Subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxx/providers/Microsoft.RecoveryServices/vaults/xxxx

xxxxxxxx/replicationJobs/1c609a5b-324e-461c-866f-ad58f944df25

Type :

JobType : AddProtectionProfile

DisplayName : Create replication policy

ClientRequestId : b10c83ee-fee2-42d4-ad1d-dfc3e166faab ActivityId: 67e8453c-fae0-465f-801c-dfa2e6e6ee23

State : Succeeded

StateDescription : Completed

StartTime : 8/29/2017 10:18:10 AM

EndTime : 8/29/2017 10:18:11 AM

TargetObjectId : bb8e8c57-221d-5668-9d82-b15a3e19a6a3

TargetObjectType : ProtectionProfile

TargetObjectName : abc122

AllowedActions :

Tasks : {Prerequisites check for creating the replication policy, Creating the replication policy}

Errors : {}



Starts the replication policy creation operation using the specified parameters and returns the ASR job used to track the operation.





Example 3



PS C:\\> New-AzureRmRecoveryServicesAsrPolicy -Name $policyName1 -ReplicationProvider InMageAzureV2 -RecoveryPoints 40

-RPOWarningThresholdInMinutes 5 -ApplicationConsistentSnapshotFrequencyInMinutes 15

Name : ed69e451-878b-4f19-9c0f-73184be05eaf

ID : /Subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxx/providers/Microsoft.RecoveryServices/vaults/xxxx

xxxxxxxx/replicationJobs/ed69e451-878b-4f19-9c0f-73184be05eaf

Type :

JobType :

DisplayName :

ClientRequestId : d8922fa2-303c-4eb4-b556-e07969ea6fba ActivityId: 9e946cdf-2351-44c2-9aef-70ef2eab29b4

State : NotStarted

StateDescription : NotStarted

StartTime :

EndTime :

TargetObjectId :

TargetObjectType :

TargetObjectName :

AllowedActions :

Tasks : {}

Errors : {}









Example 4



PS C:\\> $Job = New-AzureRmRecoveryServicesAsrPolicy -Name $TestPolicy1 -AzureToAzure -RecoveryPointRetentionInHours 10

-ApplicationConsistentSnapshotFrequencyInHours 5

PS C:\\> Get-AsrJob -name $Job.id



Starts the replication policy creation operation using the specified parameters and returns the ASR job used to track the operation.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... sasrpolicy

Get-AzureRmRecoveryServicesAsrPolicy

Remove-AzureRmRecoveryServicesAsrPolicy