/// <summary> /// Associates protection profile with enterprise based protection containers /// </summary> private void EnterpriseToEnterpriseAssociation() { if (string.Compare( this.ProtectionProfile.ReplicationProvider, Constants.HyperVReplica, StringComparison.OrdinalIgnoreCase) != 0) { throw new InvalidOperationException( string.Format( Properties.Resources.IncorrectReplicationProvider, this.ProtectionProfile.ReplicationProvider)); } ProtectionProfileAssociationInput protectionProfileAssociationInput = new ProtectionProfileAssociationInput( this.PrimaryProtectionContainer.Name, this.RecoveryProtectionContainer.Name); LongRunningOperationResponse response = RecoveryServicesClient.AssociateAzureSiteRecoveryProtectionProfile( this.ProtectionProfile.Name, protectionProfileAssociationInput); JobResponse jobResponse = RecoveryServicesClient .GetAzureSiteRecoveryJobDetails(PSRecoveryServicesClient.GetJobIdFromReponseLocation(response.Location)); this.WriteObject(new ASRJob(jobResponse.Job)); }