diff --git a/ChangeLog.md b/ChangeLog.md index 8c38cdefb168..8abcfbc57b6d 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,7 @@ ## 2015.09.03 version 0.9.8 - +* Azure Compute (ARM) Cmdlets + * Add -Launch parameter for Get-AzureRemoteDesktopFile cmdlet + ## 2015.08.17 version 0.9.7 * Azure Profile cmdlets * New-AzureProfile diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupCmdletHelpMessage.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupCmdletHelpMessage.cs index ac217acd4b19..17f92b3a7ecb 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupCmdletHelpMessage.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupCmdletHelpMessage.cs @@ -16,84 +16,129 @@ namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets { internal static class AzureBackupCmdletHelpMessage { - public const string Vault = "The vault details"; - public const string ResourceGroupName = "The ResourceGroup name."; - public const string ResourceName = "The Resource name."; - public const string Location = "The resource location."; - public const string TargetLocation = "The directory where the credentials file will be saved. This must be an absolute path."; - public const string StorageType = "The vault back-end storage type."; - public const string ManagedResourceName = "The resource name of the resource being managed by the Azure Backup service (ex: resource name of the VM)."; - public const string ManagedResourceGroupName = "The resource group name of the resource being managed by the Azure Backup service (ex: resource group name of the VM)."; - public const string ContainerRegistrationStatus = "The container registration status."; - public const string ContainerType = "The container type."; - public const string AzureBackupContainer = "Azure Backup Container for Azure Backup Item."; - - public const string PolicyName = "The protection policy name."; + /* Unidentified strings - not scrubbed */ public const string ResourceTags = "A hash table which represents resource tags."; - public const string ContainerId = "The container ID."; - - public const string JobFilterJobIdHelpMessage = "The job ID to filter jobs"; - public const string JobFilterJobHelpMessage = "The job for filtering"; - public const string JobFilterStartTimeHelpMessage = "The start time of query range"; - public const string JobFilterEndTimeHelpMessage = "The end time of query range"; - public const string JobFilterOperationHelpMessage = "The operation for filtering jos"; - public const string JobFilterStatusHelpMessage = "The status for filtering jobs"; - public const string JobFitlerVaultHelpMessage = "The vault of which jobs have to be filtered"; - public const string JobFilterTypeHelpMessage = "The type of workload whose jobs have to be filtered"; - - public const string JobDetailsFilterJobIdHelpMessage = "The job ID to get details"; - public const string JobDetailsFilterVaultHelpMessage = "The vault of which job details should be fetched"; - public const string JobDetailsFilterJobHelpMessage = "The job whose full details should be fetched"; - - public const string StopJobFilterJobIdHelpMessage = "The job ID to stop job"; - public const string StopJobFilterVaultHelpMessage = "The vault of which a job has to be stopped"; - public const string StopJobFilterJobHelpMessage = "The job which should be stopped"; - - public const string WaitJobFilterJobIdHelpMessage = "The job ID to stop job"; - public const string WaitJobFilterVaultHelpMessage = "The vault of which a job has to be stopped"; - public const string WaitJobFilterJobHelpMessage = "The job which should be stopped"; - public const string WaitJobFilterTimeoutHelpMessage = "Maximum number of seconds for which cmdlet should wait before job(s) complete running."; - + public const string ContainerId = "A unique identifier for the Azure Backup container object."; public const string VirtualMachine = "Virtual Machine."; + public const string BackupType = "Type of backup."; + public const string RetentionType = "Unit of retention for the recovery point."; + public const string RententionDuration = "Specifies how long a recovery point will be retained, for a given RetentionType."; + + /* Get-AzureRMBackupVault */ + public const string ResourceGroupName = "The ResourceGroup in which the Azure resource is placed."; + public const string ResourceName = "The name of the Azure resource."; + + /* New-AzureRMBackupVault */ + //public const string ResourceGroupName + //public const string ResourceName + public const string Location = "The Azure region where the Backup vault is located."; + public const string StorageType = "The storage redundancy for the backup data stored in the vault. The currently supported storage redundancy options are Locally Redundant Storage (LRS) and Geo-Redundant Storage (GRS)."; + + /* Set-AzureRMBackupVault */ + //public const string Vault + //public const string StorageType + + /* Get-AzureRMBackupVaultCredentials */ + //public const string Vault + public const string TargetLocation = "The directory where the vault credentials file will be saved. This must be specified as an absolute path."; + + /* Get-AzureRMBackupContainer */ + public const string ManagedResourceName = "The name of the resource being managed by the Azure Backup service (for example: resource name of the VM)."; + public const string ManagedResourceGroupName = "The ResourceGroup of the resource being managed by the Azure Backup service (for example: ResourceGroup name of the VM)."; + public const string ContainerRegistrationStatus = "The registration status of the Azure Backup container."; + public const string ContainerType = "The type of the Azure Backup container. This can be a Windows Server, an Azure IaaS VM, or a Data Protection Manager server."; + //public const string Vault + + /* Get-AzureRMBackupItem */ + public const string AzureBackupContainer = "The Azure Backup container object which is the parent resource for the Azure Backup Item. The container can be a Windows Server, an Azure IaaS VM, or a Data Protection Manager server."; public const string ProtectionStatus = "Protection Status of the azure backup item."; - public const string AzureBackUpItem = "Azure BackUp Item."; - public const string RecoveryPointId = "Recovery Point Id."; - public const string StorageAccountName = "Storage Account Name."; - public const string AzureBackUpRecoveryPoint = "Recovery Point."; - public const string Type = "Type of Azure Backup Item."; public const string Status = "Status of Azure Backup Item"; - public const string AzureBackupItem = "Azure Backup Item for enabling protection"; - public const string RemoveProtectionOption = "Remove Protection Option"; - public const string Reason = "Reson for removing protection"; - public const string Comments = "Comments for for removing protection"; - public const string WorkloadType = "Workload type for which the policy is defined."; - public const string BackupType = "Type of backup."; - public const string DailyScheduleType = "Switch parameter for daily backup schedule."; - public const string WeeklyScheduleType = "Switch parameter for weekly backup schedule."; - public const string ScheduleRunDays = "Days of week for running backup, required for weekly schedule."; + public const string Type = "Type of Azure Backup Item."; + + /* Enable-AzureRMBackupProtection */ + public const string AzureBackupItemEnable = "The Azure Backup item that is being enabled for protection."; + public const string PolicyObject = "The Protection Policy object that contains all the scheduling information for backup and retention. This policy will be associated with the backup item provided as input."; + + /* Enable-AzureRMBackupContainerReregistration */ + public const string AzureBackupContainerToReregister = "The Azure Backup container to be unregistered. For this commandlet, the container cannot be of type AzureVM. Use the Get-AzureRMBackupContainer to get a list of containers."; + + /* Disable-AzureRMBackupProtection */ + public const string RemoveProtectionOption = "If this option is used, all the backup data for this item will also be deleted and restoring data will not be possible."; + public const string AzureBackupItemDisable = "Azure Backup item for which the protection is being disabled."; + public const string Reason = "User-specified reason for removing protection."; + public const string Comments = "User-specified comments provided at the time of removing protection."; + + /* Get-AzureRMBackupJob */ + public const string JobFilterJobIdHelpMessage = "The unique identifier is used as a filtering criterion. It provides details to fetch the latest information about a job."; + public const string JobFilterJobHelpMessage = "The job object is used as a filtering criterion. It provides details to fetch the latest information about a job."; + public const string JobFilterStartTimeHelpMessage = "For the time range that is used as a filtering critetion, this parameter provides the starting boundary."; + public const string JobFilterEndTimeHelpMessage = "For the time range that is used as a filtering critetion, this parameter provides the ending boundary."; + public const string JobFilterOperationHelpMessage = "The operation name of the job is used as a filtering criterion."; + public const string JobFilterStatusHelpMessage = "The status of the job is used as a filtering criterion."; + public const string JobFitlerVaultHelpMessage = "The Azure Backup vault which is the parent of the jobs being queried. This is needed only when the -Job parameter is not being used."; + public const string JobFilterTypeHelpMessage = "The type of workload is used as a filtering criterion."; + + /* Get-AzureRMBackupJobDetails */ + public const string JobDetailsFilterJobIdHelpMessage = "The unique identifier for the job whose full details are being requested"; + public const string JobDetailsFilterVaultHelpMessage = "The Azure Backup vault which is the parent resource of the job"; + public const string JobDetailsFilterJobHelpMessage = "The object that represents the job whose full details are being requested"; + + /* Stop-AzureRMBackupJob */ + public const string StopJobFilterJobIdHelpMessage = "The unique identifier for the job that needs to be stopped"; + public const string StopJobFilterVaultHelpMessage = "The Azure Backup vault which is the parent resource of the job"; + public const string StopJobFilterJobHelpMessage = "The object that represents the job that needs be stopped"; + + /* Wait-AzureRMBackupJob */ + public const string WaitJobFilterJobIdHelpMessage = "The unique identifier for the job on which the commandlet will wait for completion"; + public const string WaitJobFilterVaultHelpMessage = "The Azure Backup vault which is the parent resource of the job"; + public const string WaitJobFilterJobHelpMessage = "The object that represents the job on which the commandlet will wait for completion"; + public const string WaitJobFilterTimeoutHelpMessage = "If the commandlet should not wait infinitely for the job to finish, then this timeout value needs to be specified. The parameter specifies the maximum number of seconds for which the commandlet should wait before returning."; + + /* Register-AzureRMBackupContainer */ + public const string VMName = "The name of the Azure VM that will be registered with the service."; + public const string ServiceName = "The Cloud Service name of Azure VM"; + public const string RGName = "The ResourceGroup name of Azure VM"; + public const string Vault = "The Azure Backup vault object which is the parent resource."; + + /* Unregister-AzureRMBackupContainer */ + public const string AzureBackupContainerToUnregister = "The Azure Backup container to be unregistered. This can be a Windows Server, an Azure IaaS VM, or a Data Protection Manager server. Use the Get-AzureRMBackupContainer to get a list of containers."; + + /* New-AzureRMBackupProtectionPolicy */ + public const string PolicyName = "The name of the Azure Backup protection policy. The name of the policy should be unique within a backup vault"; + public const string WorkloadType = "Workload type for which the protection policy is defined."; + public const string DailyScheduleType = "Switch parameter to choose a daily backup schedule."; + public const string WeeklyScheduleType = "Switch parameter to choose a weekly backup schedule."; + public const string ScheduleRunDays = "Days of week on which the backup will be triggered. Required when specifying a weekly backup schedule."; public const string ScheduleRunTimes = "Times of day in UTC for running backup."; - public const string RetentionType = "Unit of retention for the recovery point."; - public const string RententionDuration = "Duration of retention for the recovery point in units specified by RetentionType."; - public const string PolicyNewName = "Policy new name"; - public const string AzureBackupPolicy = "Azure Backup protection policy"; - public const string VMName = "Azure VM name to be register"; - public const string ServiceName = "Cloud service name of Azure VM to be register"; - public const string RGName = "Resource Group name of Azure VM to be register"; - public const string AzureBackupContainerToUnregister = "Azure Backup Container tobe unregister."; - - public const string RetentionPolicyList = "List of Retention Policies to be associated with protection policy."; - public const string DailyRetention = "Switch param for Daily Retention"; - public const string WeeklyRetention = "Switch param for Daily Retention"; - public const string MonthlyRetentionInDailyFormat = "Switch param for MonthlyRetentionInDailyFormat"; - public const string MonthlyRetentionInWeeklyFormat = "Switch param for MonthlyRetentionInWeeklyFormat"; - public const string YearlyRetentionInDailyFormat = "Switch param for YearlyRetentionInDailyFormat"; - public const string YearlyRetentionInWeeklyFormat = "Switch param for YearlyRetentionInWeeklyFormat"; - public const string DaysOfWeek = "List of Days of Week"; - public const string DaysOfMonth = "List of Days of Month"; - public const string WeekNumber = "List of Week Numbers of the month"; - public const string MonthsOfYear = "List of Months of the year"; - public const string Retention = "Retention duration value"; - - public const string PolicyObject = "Policy object for enabling protection"; + public const string RetentionPolicyList = "List of Retention Policies to be associated with protection policy. You can use a combination of Daily, Weekly, Monthly, and Yearly retention policies but not more than 1 of each."; + public const string PolicyVault = "The Azure Backup vault which is the parent resource for the protection policy."; + + /* Set-AzureRMBackupProtectionPolicy */ + public const string PolicyNewName = "The new name to be given to this policy. Note that the policy name is unique to a backup vault and you need to ensure that you pick a name that does not conflict with existing names."; + public const string AzureBackupPolicy = "Azure Backup protection policy object that contains the complete policy information."; + + /* New-AzureRMBackupRetentionPolicyObject */ + public const string DailyRetention = "Switch paramater to signal that this policy is being used for Daily Retention"; + public const string WeeklyRetention = "Switch parameter to signal that this policy is being used for Weekly Retention"; + public const string MonthlyRetentionInDailyFormat = "Allows the user to specify the Monthly retention policy based on specific days of the month"; + public const string MonthlyRetentionInWeeklyFormat = "Allows the user to specify the Monthly retention policy based on specific weeks of the month"; + public const string YearlyRetentionInDailyFormat = "Allows the user to specify the Yearly retention policy based on specific days of the year"; + public const string YearlyRetentionInWeeklyFormat = "Allows the user to specify the Yearly retention policy based on specific weeks of the year"; + public const string DaysOfWeek = "Specifies the days of the week that will be used in the policy"; + public const string DaysOfMonth = "Specifies the days of the month that will be used in the policy"; + public const string WeekNumber = "Specifies the week number of the month that will be used in the policy"; + public const string MonthsOfYear = "Specifies the months of the year that will be used in the policy"; + public const string Retention = "Specifies the duration of the retention policy"; + + /* Backup-AzureRMBackupItem */ + public const string AzureBackupItem = "The Azure Backup item that is being configured for backup."; + + /* Get-AzureRMBackupRecoveryPoint */ + public const string AzureBackupItemGet = "The Azure Backup item for which the recovery points are being fetched."; + public const string RecoveryPointId = "The unique identifier for the recovery point that is being fetched."; + + /* Restore-AzureRMBackupItem */ + public const string AzureBackUpRecoveryPoint = "The PowerShell object that refers to the recovery point. Use Get-AzureRMBackupRecoveryPoint to get the PowerShell object to be used as input to this commandlet."; + public const string StorageAccountName = "The destination storage account where the restored disks and config information will be stored."; } } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupDSCmdletBase.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupDSCmdletBase.cs index 74455d5fefd4..55a426458cc0 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupDSCmdletBase.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupDSCmdletBase.cs @@ -29,7 +29,7 @@ namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets { public abstract class AzureRMBackupDSCmdletBase : AzureBackupCmdletBase { - [Parameter(Position = 0, Mandatory = true, HelpMessage = AzureBackupCmdletHelpMessage.AzureBackUpItem, ValueFromPipeline = true)] + [Parameter(Position = 0, Mandatory = true, HelpMessage = AzureBackupCmdletHelpMessage.AzureBackupItem, ValueFromPipeline = true)] [ValidateNotNullOrEmpty] public AzureRMBackupItem Item { get; set; } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/AzureBackupJobHelper.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/AzureBackupJobHelper.cs index fca51c85086b..56bbbe4a0beb 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/AzureBackupJobHelper.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/AzureBackupJobHelper.cs @@ -18,6 +18,7 @@ using System.Xml; using System.Linq; using Mgmt = Microsoft.Azure.Management.BackupServices.Models; +using Microsoft.Azure.Commands.AzureBackup.Models; namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets @@ -62,6 +63,30 @@ public static class AzureBackupJobHelper { public static DateTime MinimumAllowedDate = new DateTime(DateTime.MinValue.Year, DateTime.MinValue.Month, DateTime.MinValue.Day, DateTime.MinValue.Hour, DateTime.MinValue.Minute, DateTime.MinValue.Second, DateTimeKind.Utc); + public static string GetTypeForPS(string itemType) + { + AzureBackupItemType managedContainerType = (AzureBackupItemType)Enum.Parse(typeof(AzureBackupItemType), itemType, true); + + string returnType = string.Empty; + + switch (managedContainerType) + { + case AzureBackupItemType.IaasVM: + returnType = "AzureVM"; + break; + } + + return returnType; + } + + public static string GetTypeForService(string itemType) + { + if (itemType.CompareTo("AzureVM") == 0) + return AzureBackupItemType.IaasVM.ToString(); + throw new ArgumentException("Invalid value", "itemType"); + } + + public static bool IsValidStatus(string inputStatus) { JobStatus status; diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJob.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJob.cs index 0c8a35f7cd73..02114a59ae7c 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJob.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJob.cs @@ -56,7 +56,7 @@ public class GetAzureRMBackupJob : AzureBackupCmdletBase public string Status { get; set; } [Parameter(Mandatory = false, HelpMessage = AzureBackupCmdletHelpMessage.JobFilterTypeHelpMessage, ParameterSetName = "FiltersSet")] - [ValidateSet("IaasVM")] + [ValidateSet("AzureVM")] public string Type { get; set; } [Parameter(Mandatory = false, HelpMessage = AzureBackupCmdletHelpMessage.JobFilterOperationHelpMessage, ParameterSetName = "FiltersSet")] @@ -79,6 +79,11 @@ public override void ExecuteCmdlet() JobId = Job.InstanceId; } + if (Type != null) + { + Type = AzureBackupJobHelper.GetTypeForService(Type); + } + // validations if (!From.HasValue) { diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJobDetails.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJobDetails.cs index 742b85ae59f5..ae2607c89726 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJobDetails.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJobDetails.cs @@ -35,7 +35,7 @@ public class GetAzureRMBackupJobDetils : AzureBackupCmdletBase [Parameter(Mandatory = true, HelpMessage = AzureBackupCmdletHelpMessage.JobDetailsFilterJobIdHelpMessage, ParameterSetName = "IdFiltersSet")] [ValidateNotNullOrEmpty] - public string JobID { get; set; } + public string JobId { get; set; } [Parameter(Mandatory = true, HelpMessage = AzureBackupCmdletHelpMessage.JobDetailsFilterJobHelpMessage, ParameterSetName = "JobsFiltersSet", ValueFromPipeline = true)] [ValidateNotNull] @@ -53,12 +53,12 @@ public override void ExecuteCmdlet() { if (Job != null) { - JobID = Job.InstanceId; + JobId = Job.InstanceId; } - WriteDebug(String.Format(Resources.JobIdFilter, JobID)); + WriteDebug(String.Format(Resources.JobIdFilter, JobId)); - Mgmt.CSMJobDetailsResponse serviceJobProperties = AzureBackupClient.GetJobDetails(Vault.ResourceGroupName, Vault.Name, JobID); + Mgmt.CSMJobDetailsResponse serviceJobProperties = AzureBackupClient.GetJobDetails(Vault.ResourceGroupName, Vault.Name, JobId); AzureRMBackupJobDetails jobDetails = new AzureRMBackupJobDetails(Vault, serviceJobProperties.JobDetailedProperties, serviceJobProperties.Name); WriteDebug(Resources.JobResponse); diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Microsoft.Azure.Commands.AzureBackup.dll-help.xml b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Microsoft.Azure.Commands.AzureBackup.dll-help.xml index 453be5a0631b..e106e04e5ad7 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Microsoft.Azure.Commands.AzureBackup.dll-help.xml +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Microsoft.Azure.Commands.AzureBackup.dll-help.xml @@ -1,152 +1,32 @@  - - - - Enable-AzureBackupContainerReregistration - - Allow re-registration of the server to connect the server back to the vault and continue the backup points chain. - - - - - Enable - AzureBackupContainerReregistration - - - - When a server is destroyed, all its cloud backup points remain in the Azure Backup vault. If the server is rebuilt and given the same FQDN, it is possible to connect it back to the same vault. This will allow the server to continue taking backups and adding new backup points to the existing set - essentially continuing where it was left off in the backup chain. - To make this connection, the AzureBackupContainer has to be primed for "re-registration". Without this step, you can lose all the existing data as a part of the registration process. The commandlet tells the service that the next time the container is registered, it should continue the backup chain. - - - - Enable-AzureBackupContainerReregistration - - Container - - An object referencing the container for which re-registration is being requested - - AzureBackupContainer - - - Profile - - Non-mandatory AzureProfile input object - - AzureProfile - - - - - - Container - - An object referencing the container for which re-registration is being requested - - AzureBackupContainer - - AzureBackupContainer - - - - - - Profile - - Non-mandatory AzureProfile input object - - AzureProfile - - AzureProfile - - - - - - - - - AzureBackupContainer - - - - - - This section details out the type of the objects that you can pipe to the cmdlet. - - - - - - - - None - - - - - This section details out the type of the objects that the cmdlet emits. - - - - - - - - - None - - - - - - - - Get-AzureBackupContainer + Backup-AzureRMBackupItem - Retrieves one or more Azure Backup containers that match the filter criteria specified. + Trigger backup for a protected item - Get - AzureBackupContainer + Backup + AzureRMBackupItem - An AzureBackupContainer is an object that encapsulates datasources, protected items, and recovery points. An AzureBackupContainer can be one of three: -- a Windows server -- a System Center Data Protection Manager server (SCDPM) -- an Azure IaaS virtual machine - Before a datasource or item can be backed-up, the container holding it must be registered with the Azure Backup service and be authenticated to send backup data to the backup vault. For Windows and SCDPM servers, the registration is held with the FQDN of the server. + Using this commandlet is the equivalent of "Backup Now". It triggers an ad-hoc backup that is not tied to the backup schedule. This is useful in two scenarios: +1. Starting initial backup immediately after enabling protection +2. Triggering ad-hoc backup when a previous scheduled backup has failed - Get-AzureBackupContainer - - Name - - The name of the AzureBackupContainer for which an object reference will be returned. - - String - - - Type - - This determines the Type of the container that has been registered. -- For Windows servers using the Azure Backup agent directly, the type will be "Windows" -- For SCDPM servers using the Azure Backup agent in conjunction with SCDPM, the type will be "DPM" - - AzureBackupContainerType - + Backup-AzureRMBackupItem - Vault + Item - A filter for the vault object, under which the container needs to be found. + The Azure Backup item for which ad-hoc backup is being triggered - AzurePSBackupVault + AzureRMBackupItem Profile @@ -158,40 +38,14 @@ - - Name - - The name of the AzureBackupContainer for which an object reference will be returned. - - String - - String - - - - - - Type - - This determines the Type of the container that has been registered. -- For Windows servers using the Azure Backup agent directly, the type will be "Windows" -- For SCDPM servers using the Azure Backup agent in conjunction with SCDPM, the type will be "DPM" - - AzureBackupContainerType - - AzureBackupContainerType - - - - - Vault + Item - A filter for the vault object, under which the container needs to be found. + The Azure Backup item for which ad-hoc backup is being triggered - AzurePSBackupVault + AzureRMBackupItem - AzurePSBackupVault + AzureRMBackupItem @@ -208,42 +62,30 @@ - - ManagedResourceName - - The name of the container that is specified as a filter. - - string - - string - - - - - AzureBackupVault + AzureRMBackupItem - -This section details out the type of the objects that you can pipe to the cmdlet. + This section details out the type of the objects that you can pipe to the cmdlet. + - AzureBackupContainer + AzureRMBackupJob - -This section details out the type of the objects that the cmdlet emits. + This section details out the type of the objects that the cmdlet emits. + @@ -252,25 +94,23 @@ This section details out the type of the objects that the cmdlet emits. - None + When an existing backup job is running this commandlet will fail. - -------------------------- List of all Windows servers registered to the vault -------------------------- + -------------------------- Trigger backup for a virtual machine -------------------------- PS C:\> - Get-AzureBackupContainer -vault $v -type Windows + Get-AzureRMBackupItem -Container $c | Backup-AzureRMBackupItem - Gets a list of all containers of type "Windows" from the specified vault. - Name Type Status ----- ---- ------ -SERVER1.CONTOSO.COM Windows Registered -SERVER2.CONTOSO.COM Windows Registered - + + WorkloadName Operation Status StartTime EndTime +------------ --------- ------ --------- ------- +test-vm Backup InProgress 26-Aug-15 12:24:01 PM 01-Jan-01 12:00:00 AM @@ -281,19 +121,18 @@ SERVER2.CONTOSO.COM Windows Registered - -------------------------- Retrieve a specific container -------------------------- + -------------------------- Failure to trigger backup when an existing backup is running -------------------------- PS C:\> - Get-AzureBackupContainer -vault $v -type SCDPM -name "DPMSERVER.CONTOSO.COM" + Get-AzureRMBackupItem -Container $c | Backup-AzureRMBackupItem - Gets the container representing a specific DPM server registered to the specified vault. - Name Type Status ----- ---- ------ -DPMSERVER.CONTOSO.COM SCDPM Registered - + + WorkloadName Operation Status StartTime EndTime +------------ --------- ------ --------- ------- +test-vm Backup Failed 26-Aug-15 12:30:30 PM 26-Aug-15 12:30:30 PM @@ -310,36 +149,36 @@ DPMSERVER.CONTOSO.COM SCDPM Registered - Get-AzureBackupVault + Disable-AzureRMBackupProtection - Retrieves one or more vault objects based on the parameters that are specified. + Disable protection for a protected item - Get - AzureBackupVault + Disable + AzureRMBackupProtection - The Get-AzureBackupVault commandlet retrieves existing Azure Backup vaults and returns objects of type AzurePSBackupVault. The vault object is used in some Azure Backup commandlets as a mandatory parameter. + To stop regular scheduled backup of a backup item and to delete existing recovery points associated with the backup item. - Get-AzureBackupVault - - ResourceGroupName + Disable-AzureRMBackupProtection + + RemoveRecoveryPoints - The Azure resource group under which the vault was created. + An optional switch parameter that deletes the recovery points data associated with a backup item. It is possible to disable backup and keep the recovery points data by NOT supplying this parameter. At a later point the same commandlet can be used to delete the data - String + SwitchParameter - - Name + + Item - The name of the specific Azure Backup vault that needs to be retrieved. If no name is specified, then the commandlet returns all the vaults created by the subscription. If there is more than 1 backup vault with the same name then the commandlet returns all the vaults that match the name. Use the -ResourceGroupName parameter to filter results and get a unique vault. + The Azure Backup item for which protection is being disabled. - String + AzureRMBackupItem Profile @@ -351,26 +190,26 @@ DPMSERVER.CONTOSO.COM SCDPM Registered - - ResourceGroupName + + RemoveRecoveryPoints - The Azure resource group under which the vault was created. + An optional switch parameter that deletes the recovery points data associated with a backup item. It is possible to disable backup and keep the recovery points data by NOT supplying this parameter. At a later point the same commandlet can be used to delete the data - String + SwitchParameter - String + SwitchParameter - - Name + + Item - The name of the specific Azure Backup vault that needs to be retrieved. If no name is specified, then the commandlet returns all the vaults created by the subscription. If there is more than 1 backup vault with the same name then the commandlet returns all the vaults that match the name. Use the -ResourceGroupName parameter to filter results and get a unique vault. + The Azure Backup item for which protection is being disabled. - String + AzureRMBackupItem - String + AzureRMBackupItem @@ -387,30 +226,52 @@ DPMSERVER.CONTOSO.COM SCDPM Registered + + Reason + + + + string + + string + + + + + + Comments + + + + string + + string + + + + - Vault name as [String] + AzureRMBackupItem - -This section details out the type of the objects that you can pipe to the cmdlet. + This section details out the type of the objects that you can pipe to the cmdlet. - Microsoft.Azure.Commands.AzureBackup.Models.AzurePSBackupVault + AzureRMBackupJob - -This section details out the type of the objects that the cmdlet emits. + This section details out the type of the objects that the cmdlet emits. @@ -423,149 +284,37 @@ This section details out the type of the objects that the cmdlet emits. - - -------------------------- View all the Azure Backup vaults created -------------------------- - - PS C:\> - - Get-AzureBackupVault - - - - - - - - - - - - - - - - -------------------------- Get a list of all vaults created in West US -------------------------- - - PS C:\> - - Get-AzureBackupVault | Where-Object { $_.Region -eq "westus" } - - - - - - - - - - - - - - - - -------------------------- Get a reference to a specific vault -------------------------- - - PS C:\> - - Get-AzureBackupVault -Name "myvault" - - - - - ResourceId : /subscriptions/4bfbe168-f42a-4a06-8f5a-331cad1f497e/resourceGroups/rg1/providers/Microsoft.Backup - /BackupVault/myvault -Name : myvault -ResourceGroupName : rg1 -Region : westus -Storage : GeoRedundant - - - - - - - - - - - -------------------------- Count the number of vaults having Locally Redundant Storage -------------------------- - - PS C:\> - - Get-AzureBackupVault | Where-Object { $_.Storage –match ‘LocallyRedundant’ } | Measure-Object - - - - - Count : 4 -Average : -Sum : -Maximum : -Minimum : -Property : - - - - - - - - - - - New-AzureBackupVault - - - - Set-AzureBackupVault - - - - Remove-AzureBackupVault - - - - Get-AzureBackupContainer - - - Get-AzureBackupVaultCredentials + Enable-AzureRMBackupContainerReregistration - Downloads the Vault Credentials file to a specified location. + Allow re-registration of the server to connect the server back to the vault and continue the backup points chain. - Get - AzureBackupVaultCredentials + Enable + AzureRMBackupContainerReregistration - To enable hybrid backup scenarios the Vault Credentials file is a critical component. The vault credential file is used to connect a server to the Azure Backup vault and register it. Only after registration can backup data be sent to the vault. The Get-AzureBackupVaultCredentials commandlet downloads and places a vault credential file at the location specified by the user. + When a server is destroyed, all its cloud backup points remain in the Azure Backup vault. If the server is rebuilt and given the same FQDN, it is possible to connect it back to the same vault. This will allow the server to continue taking backups and adding new backup points to the existing set - essentially continuing where it was left off in the backup chain. + To make this connection, the AzureBackupContainer has to be primed for "re-registration". Without this step, you can lose all the existing data as a part of the registration process. The commandlet tells the service that the next time the container is registered, it should continue the backup chain. - Get-AzureBackupVaultCredentials - - TargetLocation - - The destination path where the Vault Credentials file should be placed. - - String - + Enable-AzureRMBackupContainerReregistration - Vault + Container - The specific Azure Backup vault object for which the Vault Credential file is generated. + An object referencing the container for which re-registration is being requested - AzurePSBackupVault + AzureRMBackupContainer Profile @@ -577,26 +326,132 @@ Property : - - TargetLocation + + Container - The destination path where the Vault Credentials file should be placed. + An object referencing the container for which re-registration is being requested - String + AzureRMBackupContainer - String + AzureRMBackupContainer - - Vault + + Profile - The specific Azure Backup vault object for which the Vault Credential file is generated. + Non-mandatory AzureProfile input object - AzurePSBackupVault + AzureProfile + + AzureProfile + + + + + + + + + AzureBackupContainer + + + + + This section details out the type of the objects that you can pipe to the cmdlet. + + + + + + + None + + + + + + + + + + + + + + None + + + + + + + + + + + Enable-AzureRMBackupProtection + + Associate an item with a protection policy + + + + + Enable + AzureRMBackupProtection + + + + Enabling protection involves two key entities - the AzureRMBackupItem and the AzureRMBackupProtectionPolicy. Both need to belong to the same vault. The backup schedule will take care of doing the full initial copy for the item and the incremental copy for the subsequent backups. + + + + Enable-AzureRMBackupProtection + + Policy + + The Azure Backup protection policy that will be associated with the item. + + AzureRMBackupProtectionPolicy + + + Item + + The Azure Backup item object for which protection is being enabled. + + AzureRMBackupContainerContextObject + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + + + Policy + + The Azure Backup protection policy that will be associated with the item. + + AzureRMBackupProtectionPolicy + + AzureRMBackupProtectionPolicy + + + + + + Item + + The Azure Backup item object for which protection is being enabled. + + AzureRMBackupContainerContextObject - AzurePSBackupVault + AzureRMBackupContainerContextObject @@ -617,7 +472,7 @@ Property : - Microsoft.Azure.Commands.AzureBackup.Models.AzurePSBackupVault + AzureRMBackupItem @@ -629,7 +484,7 @@ Property : - Vault Credentials file name as [String] + AzureRMBackupJob @@ -648,16 +503,18 @@ Property : - -------------------------- Download a Vault Credentials file -------------------------- + -------------------------- Enable protection on an Azure VM -------------------------- PS C:\> - Get-AzureBackupVaultCredentials -Vault $vaultobj -TargetLocation "C:\users\admin\Desktop" + Get-AzureRMBackupContainer -Type AzureVM -Status Registered -Vault $v | Get-AzureRMBackupItem | Enable-AzureRMBackupProtection -Policy $policies[0] - This will place the vault credentials file at the user-specified location. - f5303a0b-fae4-4cdb-b44d-0e4c032dde26_backuprg_backuprn_2015-06-7--06-22-35.VaultCredentials + + WorkloadName Operation Status StartTime EndTime +------------ --------- ------ --------- ------- +test-vm ConfigureBackup Completed 26-Aug-15 12:19:49 PM 26-Aug-15 12:19:54 PM @@ -669,55 +526,78 @@ Property : + + Get-AzureRMBackupItem + + + + Get-AzureRMBackupProtectionPolicy + + + + Backup-AzureRMBackupItem + + - New-AzureBackupVault + Get-AzureRMBackupContainer - Creates a new Azure Backup vault based on the parameters that are specified. A vault is the start point for all backup operations with Azure Backup. + Retrieves one or more Azure Backup containers that match the filter criteria specified. - New - AzureBackupVault + Get + AzureRMBackupContainer - The New-AzureBackupVault commandlet creates and Azure Backup vault and returns an object of type AzurePSBackupVault that acts as a reference to the vault entity. The vault has some important properties that define the scope of backup – the region and the storage type. + An AzureBackupContainer is an object that encapsulates datasources, protected items, and recovery points. An AzureBackupContainer can be one of three: +- a Windows server +- a System Center Data Protection Manager server (SCDPM) +- an Azure IaaS virtual machine + Before a datasource or item can be backed-up, the container holding it must be registered with the Azure Backup service and be authenticated to send backup data to the backup vault. For Windows and SCDPM servers, the registration is held with the FQDN of the server. - New-AzureBackupVault - - ResourceGroupName + Get-AzureRMBackupContainer + + Name - Specifies the name of an existing resource group. In order to create a resource group, use the New-AzureResourceGroup commandlet. There is no requirement that the Azure ResourceGroup and the Azure Backup vault be in the same region. + Name of the container to be retrieved. String - - Name + + Type - Specifies the name of the Azure Backup vault. The combination of ResourceGroupName and Name must be unique. You cannot create two vaults with the same name under the same ResourceGroup, but two vaults with the same name can be placed under two different Resource Groups. + Type of the container. Currently supported types are Windows - String + AzureBackupContainerType - - Region + + ManagedResourceGroupName - The region parameter places the vault object into a specific Azure region. For hybrid backup scenarios, it is advised to create a vault in a region close to the on-premise server to reduce latency. For backup of Azure IaaS virtual machines, the vault becomes the point of discovery for local virtual machines. + The resource group name associated with the container. When registering the container this input would have been provided using the -ServiceName or the -ResourceGroupName parameter. String - - Storage + + Status - Backup storage is billed at Azure Storage rates and users can choose between LocallyRedundant and GeoRedundant as the storage for the backup data. Since this is an optional parameter, if it is not specified then the vault is created with the GeoRedundant Storage option. + The current status of the container object. Supported values are: NotRegistered, Registered, Registering, - AzureBackupVaultStorageType + AzureBackupContainerRegistrationStatus + + + Vault + + The Azure Backup vault from to which the container is associated. + + AzureRMBackupVault Profile @@ -729,10 +609,10 @@ Property : - - ResourceGroupName + + Name - Specifies the name of an existing resource group. In order to create a resource group, use the New-AzureResourceGroup commandlet. There is no requirement that the Azure ResourceGroup and the Azure Backup vault be in the same region. + Name of the container to be retrieved. String @@ -741,22 +621,22 @@ Property : - - Name + + Type - Specifies the name of the Azure Backup vault. The combination of ResourceGroupName and Name must be unique. You cannot create two vaults with the same name under the same ResourceGroup, but two vaults with the same name can be placed under two different Resource Groups. + Type of the container. Currently supported types are Windows - String + AzureBackupContainerType - String + AzureBackupContainerType - - Region + + ManagedResourceGroupName - The region parameter places the vault object into a specific Azure region. For hybrid backup scenarios, it is advised to create a vault in a region close to the on-premise server to reduce latency. For backup of Azure IaaS virtual machines, the vault becomes the point of discovery for local virtual machines. + The resource group name associated with the container. When registering the container this input would have been provided using the -ServiceName or the -ResourceGroupName parameter. String @@ -765,14 +645,26 @@ Property : - - Storage + + Status - Backup storage is billed at Azure Storage rates and users can choose between LocallyRedundant and GeoRedundant as the storage for the backup data. Since this is an optional parameter, if it is not specified then the vault is created with the GeoRedundant Storage option. + The current status of the container object. Supported values are: NotRegistered, Registered, Registering, - AzureBackupVaultStorageType + AzureBackupContainerRegistrationStatus - AzureBackupVaultStorageType + AzureBackupContainerRegistrationStatus + + + + + + Vault + + The Azure Backup vault from to which the container is associated. + + AzureRMBackupVault + + AzureRMBackupVault @@ -793,26 +685,24 @@ Property : - None + AzureBackupVault - -This section details out the type of the objects that you can pipe to the cmdlet. + This section details out the type of the objects that you can pipe to the cmdlet. - Microsoft.Azure.Commands.AzureBackup.Models.AzurePSBackupVault + AzureBackupContainer - -This section details out the type of the objects that the cmdlet emits. + This section details out the type of the objects that the cmdlet emits. @@ -826,21 +716,41 @@ This section details out the type of the objects that the cmdlet emits. - -------------------------- Create a new backup vault -------------------------- + -------------------------- List of all Windows servers registered to the vault -------------------------- PS C:\> - New-AzureBackupVault –ResourceGroupName “rg1” –Name “vault1” –Region “westus” + Get-AzureBackupContainer -vault $v -type Windows + Gets a list of all containers of type "Windows" from the specified vault. + Name Type Status +---- ---- ------ +SERVER1.CONTOSO.COM Windows Registered +SERVER2.CONTOSO.COM Windows Registered + + + + + + + + + + + -------------------------- Retrieve a specific container -------------------------- + + PS C:\> + + Get-AzureBackupContainer -vault $v -type SCDPM -name "DPMSERVER.CONTOSO.COM" + + Gets the container representing a specific DPM server registered to the specified vault. + - ResourceId : /subscriptions/4bfbe168-f42a-4a06-8f5a-331cad1f497e/resourceGroups/rg1/providers/Microsoft.Backup - /BackupVault/vault1 -Name : vault1 -ResourceGroupName : rg1 -Region : westus -Storage : GeoRedundant + Name Type Status +---- ---- ------ +DPMSERVER.CONTOSO.COM SCDPM Registered @@ -851,21 +761,18 @@ Storage : GeoRedundant - -------------------------- Create a new backup vault with Locally Redundant Storage -------------------------- + -------------------------- List all registered Azure VMs -------------------------- PS C:\> - New-AzureBackupVault –ResourceGroupName “rg2” –Name “vault2” –Region “westus” –Storage LocallyRedundant + Get-AzureRMBackupContainer -Type AzureVM -Status Registered -Vault $v - ResourceId : /subscriptions/4bfbe168-f42a-4a06-8f5a-331cad1f497e/resourceGroups/rg2/providers/Microsoft.Backup - /BackupVault/vault2 -Name : vault2 -ResourceGroupName : rg2 -Region : westus -Storage : LocallyRedundant + Name Type Status +---- ---- ------ +test-vm AzureVM Registered @@ -878,19 +785,3451 @@ Storage : LocallyRedundant - New-AzureResourceGroup - https://msdn.microsoft.com/en-us/library/dn654594.aspx - - - Get-AzureBackupVault - - - - Set-AzureBackupVault - - - - Remove-AzureBackupVault + Register-AzureRMBackupContainer + + + + Unregister-AzureRMBackupContainer + + + + + + + + Get-AzureRMBackupItem + + Gets the items under a container + + + + + Get + AzureRMBackupItem + + + + A container registered to the Azure Backup vault can have one or more items that can be protected. These items are enabled for protection using the Enable-AzureRMBackupProtection commandlet. This commandlet gets all the items under the container and their protection status. + + + + Get-AzureRMBackupItem + + ProtectionStatus + + The overall protection status of the item in the container. Supported values are: Protected, Protecting. + + String + + + Status + + The backup status for the item. Supported values are: IRPending, Protected, ProtectionError, ProtectionStopped. This is a sub-status that can be used as a filter for items that have -ProtectionStatus as Protected. + + String + + + Type + + The type of item that is being requested. Supported values: AzureVM + + String + + + Container + + The parent container object for which we are querying the items. Use the Get-AzureRMBackupContainer commandlet to get the list of containers in the vault. + + AzureRMBackupContainer + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + + + ProtectionStatus + + The overall protection status of the item in the container. Supported values are: Protected, Protecting. + + String + + String + + + + + + Status + + The backup status for the item. Supported values are: IRPending, Protected, ProtectionError, ProtectionStopped. This is a sub-status that can be used as a filter for items that have -ProtectionStatus as Protected. + + String + + String + + + + + + Type + + The type of item that is being requested. Supported values: AzureVM + + String + + String + + + + + + Container + + The parent container object for which we are querying the items. Use the Get-AzureRMBackupContainer commandlet to get the list of containers in the vault. + + AzureRMBackupContainer + + AzureRMBackupContainer + + + + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + AzureProfile + + + + + + + + + AzureRMBackupContainer + + + + + This section details out the type of the objects that you can pipe to the cmdlet. + + + + + + + AzureRMBackupItem + + + + + This section details out the type of the objects that the cmdlet emits. + + + + + + + + + For Azure VMs, there is only one item under the registered VM container. + + + + + -------------------------- Get a list of all items in a container -------------------------- + + PS C:\> + + Get-AzureRMBackupContainer -Type AzureVM -Name "test-vm" -Vault $v | Get-AzureRMBackupItem + + + + + Name ProtectionStatus DataSourceStatus RecoveryPointsCount ProtectionPolicyName +---- ---------------- ---------------- ------------------- -------------------- +test-vm NotProtected 0 + + + + + + + + + + + -------------------------- See all the fields for an item -------------------------- + + PS C:\> + + Get-AzureRMBackupItem -Container $c | select * + + + + + Name : test-vm +DataSourceStatus : +ProtectionStatus : NotProtected +Type : AzureVM +ProtectionPolicyName : +ProtectionPolicyId : +RecoveryPointsCount : 0 +ItemName : iaasvmcontainer;test-vm;test-vm +ContainerType : AzureVM +ContainerUniqueName : iaasvmcontainer;test-vm;test-vm +ResourceGroupName : test-rg +ResourceName : test-vault +Location : southeastasia + + + + + + + + + + + + + Restore-AzureRMBackupItem + + + + Get-AzureRMBackupContainer + + + + Enable-AzureRMBackupProtection + + + + Backup-AzureRMBackupItem + + + + Disable-AzureRMBackupProtection + + + + + + + + Get-AzureRMBackupJob + + Retrieves a list of jobs or a specific job + + + + + Get + AzureRMBackupJob + + + + This commandlet gets the Azure Backup jobs that match the filter criteria specified. The jobs returned are restricted to the Azure Backup vault. + + + + Get-AzureRMBackupJob + + Vault + + The specific Azure Backup vault object for which the jobs are being retrieved. The vault is the parent container for an Azure Backup job, and any given job must be a part of a specified vault. Use the Get-AzureRMBackupVault to get a list of vaults. + + AzureRMBackupVault + + + JobId + + The unique identifier for the Azure Backup job. + + String + + + From + + A time range is specified to filter the list of jobs returned from the Azure Backup service. This parameter specifies the start time for the time range. + When this parameter is not specified, the default is _____ + When the -To parameter is used the -From parameter is mandatory. + + Nullable`1[DateTime] + + + To + + A time range is specified to filter the list of jobs returned from the Azure Backup service. This parameter specifies the end time for the time range. + When this parameter is not specified, the default vault is the current system date/time. + + Nullable`1[DateTime] + + + Status + + A filter value to get jobs with the specified status. Typically the status field is used to get InProgress and Failed jobs. + Supported values: +- InProgress +- Failed +- Cancelled +- Cancelling +- Completed +- CompletedWithWarnings + + String + + + Type + + The type of container that is used as a filter. The only supported item currently is AzureVM. + + String + + + Operation + + A filter that describes the specific operation for which the jobs will be retrieved. + Supported values: +- Backup +- ConfigureBackup +- DeleteBackupData +- Register +- Restore +- UnProtect +- Unregister + + String + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + Get-AzureRMBackupJob + + Job + + When you use the -Job parameter, the commandlet fetches the latest status for the job. Identifying the job is done using the details provided in the input object. This input object would also have been returned earlier from Get-AzureRMBackupJob. + + AzureRMBackupJob + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + + + Vault + + The specific Azure Backup vault object for which the jobs are being retrieved. The vault is the parent container for an Azure Backup job, and any given job must be a part of a specified vault. Use the Get-AzureRMBackupVault to get a list of vaults. + + AzureRMBackupVault + + AzureRMBackupVault + + + + + + JobId + + The unique identifier for the Azure Backup job. + + String + + String + + + + + + From + + A time range is specified to filter the list of jobs returned from the Azure Backup service. This parameter specifies the start time for the time range. + When this parameter is not specified, the default is _____ + When the -To parameter is used the -From parameter is mandatory. + + Nullable`1[DateTime] + + Nullable`1[DateTime] + + + + + + To + + A time range is specified to filter the list of jobs returned from the Azure Backup service. This parameter specifies the end time for the time range. + When this parameter is not specified, the default vault is the current system date/time. + + Nullable`1[DateTime] + + Nullable`1[DateTime] + + + + + + Status + + A filter value to get jobs with the specified status. Typically the status field is used to get InProgress and Failed jobs. + Supported values: +- InProgress +- Failed +- Cancelled +- Cancelling +- Completed +- CompletedWithWarnings + + String + + String + + + + + + Type + + The type of container that is used as a filter. The only supported item currently is AzureVM. + + String + + String + + + + + + Operation + + A filter that describes the specific operation for which the jobs will be retrieved. + Supported values: +- Backup +- ConfigureBackup +- DeleteBackupData +- Register +- Restore +- UnProtect +- Unregister + + String + + String + + + + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + AzureProfile + + + + + + Job + + When you use the -Job parameter, the commandlet fetches the latest status for the job. Identifying the job is done using the details provided in the input object. This input object would also have been returned earlier from Get-AzureRMBackupJob. + + AzureRMBackupJob + + AzureRMBackupJob + + + + + + + + + AzureRMBackupVault + + + + + This section details out the type of the objects that you can pipe to the cmdlet. + + + + + + + AzureRMBackupJob object (or) +Array of AzureRMBackupJob objects + + + + + This section details out the type of the objects that the cmdlet emits. + + + + + + + + + None + + + + + -------------------------- Retrieve a list of jobs from the backup vault -------------------------- + + PS C:\> + + Get-AzureRMBackupJob -Vault $v + + + + + WorkloadName Operation Status StartTime EndTime +------------ --------- ------ --------- ------- +test-vm Backup InProgress 26-Aug-15 12:24:01 PM 01-Jan-01 12:00:00 AM +test-vm ConfigureBackup Completed 26-Aug-15 12:19:49 PM 26-Aug-15 12:19:54 PM +test-vm Register Completed 25-Aug-15 3:23:53 PM 25-Aug-15 3:25:00 PM + + + + + + + + + + + -------------------------- Retrieve a list of completed jobs -------------------------- + + PS C:\> + + Get-AzureRMBackupJob -Vault $v -Status Completed + + + + + WorkloadName Operation Status StartTime EndTime +------------ --------- ------ --------- ------- +test-vm Register Completed 25-Aug-15 3:23:53 PM 25-Aug-15 3:25:00 PM + + + + + + + + + + + -------------------------- Retrieve a list of failed jobs for the last 1 week -------------------------- + + PS C:\> + + Get-AzureRMBackupJob -Vault $v -From (Get-Date).AddDays(-7) -Status Failed + + + + + + + + + + + + + + + + -------------------------- Poll the service for a change in the job status -------------------------- + + PS C:\> + + $joblist = Get-AzureRMBackupJob -Vault $v -Status InProgress +$job = $joblist[0] + +while ( $job.Status -ne Completed ) +{ + Write-Host "Waiting for completion..." + Start-Sleep -s 10 + $job = Get-AzureRMBackupJob -Vault $v -Job $job +} +Write-Host "Done!" + + + + + Waiting for completion... +Waiting for completion... +Waiting for completion... +Done! + + + + + + + + + + + + + + + + + Get-AzureRMBackupJobDetails + + Get the details of a job + + + + + Get + AzureRMBackupJobDetails + + + + When a job has failed, the Azure Backup service typically logs more information for debugging purposes. The detailed job information can be retrieved using this commandlet + + + + Get-AzureRMBackupJobDetails + + Job + + The job object for which details are to be retrieved + + AzureRMBackupJob + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + Get-AzureRMBackupJobDetails + + Vault + + The Azure Backup vault under which the job can be found. + + AzureRMBackupVault + + + JobId + + The unique identifier for the job, for which the details are to be retrieved. + + String + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + + + Job + + The job object for which details are to be retrieved + + AzureRMBackupJob + + AzureRMBackupJob + + + + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + AzureProfile + + + + + + Vault + + The Azure Backup vault under which the job can be found. + + AzureRMBackupVault + + AzureRMBackupVault + + + + + + JobId + + The unique identifier for the job, for which the details are to be retrieved. + + String + + String + + + + + + + + + None + + + + + + + + + + + + + AzureRMBackupJobDetails + + + + + This section details out the type of the objects that the cmdlet emits. + + + + + + + + + None + + + + + -------------------------- Get the details of a failed job -------------------------- + + PS C:\> + + $jd = Get-AzureRMBackupJobDetails -Job $j +PS C:\> $jd.ErrorDetails + + + + + + ErrorCode ErrorMessage Recommendations +--------- ------------ --------------- + 400001 Command execution failed. {Another operation is currently in p... + + + + + + + + + + + -------------------------- Get the recommended action for a failed job -------------------------- + + PS C:\> + + $jd.ErrorDetails.Recommendations + + + + + Another operation is currently in progress on this item. Please wait until the previous operation is completed, and then retry. + + + + + + + + + + + + + + + + + Get-AzureRMBackupProtectionPolicy + + Fetches the backup policies in a backup vault + + + + + Get + AzureRMBackupProtectionPolicy + + + + The backup policy is used in the Enable-AzureRMBackupProtection commandlet to enable protection on an item. The policy must be created using the New-AzureRMBackupProtectionPolicy commandlet, or an existing policy can be used. This commandlet gets the list of existing policies in the backup vault. + + + + Get-AzureRMBackupProtectionPolicy + + Name + + The name of the specific policy. Since policy names are unique within a vault, the name is sufficient to identify a policy. + + String + + + Vault + + The Azure Backup vault under which the policy has been created. + + AzureRMBackupVault + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + + + Name + + The name of the specific policy. Since policy names are unique within a vault, the name is sufficient to identify a policy. + + String + + String + + + + + + Vault + + The Azure Backup vault under which the policy has been created. + + AzureRMBackupVault + + AzureRMBackupVault + + + + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + AzureProfile + + + + + + + + + AzureRMBackupVault + + + + + This section details out the type of the objects that you can pipe to the cmdlet. + + + + + + + AzureRMBackupProtectionPolicy + + + + + This section details out the type of the objects that the cmdlet emits. + + + + + + + + + None + + + + + -------------------------- Get the list of policies in a vault -------------------------- + + PS C:\> + + Get-AzureRMBackupProtectionPolicy -Vault $v + + + + + Name Type ScheduleType BackupTime +---- ---- ------------ ---------- +test01 AzureVM Daily 26-Aug-15 3:00:00 PM +DailyBkp AzureVM Daily 26-Aug-15 3:00:00 PM +DefaultPolicy AzureVM Daily 26-Aug-15 12:30:00 AM +WeeklyBkp AzureVM Weekly 26-Aug-15 5:00:00 PM +test2 AzureVM Daily 26-Aug-15 3:00:00 PM + + + + + + + + + + + -------------------------- Get a specific policy from a vault -------------------------- + + PS C:\> + + Get-AzureRMBackupProtectionPolicy -Vault $v -Name DefaultPolicy + + + + + Name Type ScheduleType BackupTime +---- ---- ------------ ---------- +DefaultPolicy AzureVM Daily 26-Aug-15 12:30:00 AM + + + + + + + + + + + + + New-AzureRMBackupProtectionPolicy + + + + Enable-AzureRMBackupProtection + + + + Remove-AzureRMBackupProtectionPolicy + + + + + + + + Get-AzureRMBackupRecoveryPoint + + Get the recovery point(s) for a backed-up item + + + + + Get + AzureRMBackupRecoveryPoint + + + + Once an item has been backed up, it will have one or more recovery points. This commandlet gets a list of the recovery points + + + + Get-AzureRMBackupRecoveryPoint + + RecoveryPointId + + The ID to retrieve a specific recovery point for an item + + String + + + Item + + The item object for which the recovery points are being queried. + + AzureRMBackupItem + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + + + RecoveryPointId + + The ID to retrieve a specific recovery point for an item + + String + + String + + + + + + Item + + The item object for which the recovery points are being queried. + + AzureRMBackupItem + + AzureRMBackupItem + + + + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + AzureProfile + + + + + + + + + AzureRMBackupItem + + + + + This section details out the type of the objects that you can pipe to the cmdlet. + + + + + + + AzureRMBackupRecoveryPoint + + + + + This section details out the type of the objects that the cmdlet emits. + + + + + + + + + + + + + + + -------------------------- Get a list of recovery points for an item -------------------------- + + PS C:\> + + Get-AzureRMBackupRecoveryPoint -Item $backupitem + + + + + RecoveryPointId RecoveryPointType RecoveryPointTime ContainerName +--------------- ----------------- ----------------- ------------- +15273496567119 AppConsistent 26-Aug-15 12:27:38 PM iaasvmcontainer;aashish-vm;aashis... + + + + + + + + + + + + + + + + + Get-AzureRMBackupVault + + Retrieves one or more vault objects based on the parameters that are specified. + + + + + Get + AzureRMBackupVault + + + + The Get-AzureRMBackupVault commandlet retrieves existing Azure Backup vaults and returns objects of type AzurePSBackupVault. The vault object is used in some Azure Backup commandlets as a mandatory parameter. + + + + Get-AzureRMBackupVault + + ResourceGroupName + + The Azure resource group under which the vault was created. + + String + + + Name + + The name of the specific Azure Backup vault that needs to be retrieved. If no name is specified, then the commandlet returns all the vaults created by the subscription. If there is more than 1 backup vault with the same name then the commandlet returns all the vaults that match the name. Use the -ResourceGroupName parameter to filter results and get a unique vault. + + String + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + + + ResourceGroupName + + The Azure resource group under which the vault was created. + + String + + String + + + + + + Name + + The name of the specific Azure Backup vault that needs to be retrieved. If no name is specified, then the commandlet returns all the vaults created by the subscription. If there is more than 1 backup vault with the same name then the commandlet returns all the vaults that match the name. Use the -ResourceGroupName parameter to filter results and get a unique vault. + + String + + String + + + + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + AzureProfile + + + + + + + + + Vault name as [String] + + + + + This section details out the type of the objects that you can pipe to the cmdlet. + + + + + + + AzureRMBackupVault + + + + + This section details out the type of the objects that the cmdlet emits. + + + + + + + + + None + + + + + -------------------------- View all the Azure Backup vaults created -------------------------- + + PS C:\> + + Get-AzureBackupVault + + + + + + + + + + + + + + + + -------------------------- Get a list of all vaults created in West US -------------------------- + + PS C:\> + + Get-AzureBackupVault | Where-Object { $_.Region -eq "westus" } + + + + + + + + + + + + + + + + -------------------------- Get a reference to a specific vault -------------------------- + + PS C:\> + + Get-AzureBackupVault -Name "myvault" + + + + + ResourceId : /subscriptions/4bfbe168-f42a-4a06-8f5a-331cad1f497e/resourceGroups/rg1/providers/Microsoft.Backup + /BackupVault/myvault +Name : myvault +ResourceGroupName : rg1 +Region : westus +Storage : GeoRedundant + + + + + + + + + + + -------------------------- Count the number of vaults having Locally Redundant Storage -------------------------- + + PS C:\> + + Get-AzureBackupVault | Where-Object { $_.Storage –match ‘LocallyRedundant’ } | Measure-Object + + + + + Count : 4 +Average : +Sum : +Maximum : +Minimum : +Property : + + + + + + + + + + + + + New-AzureRMBackupVault + + + + Set-AzureRMBackupVault + + + + Remove-AzureRMBackupVault + + + + Get-AzureRMBackupContainer + + + + + + + + Get-AzureRMBackupVaultCredentials + + Downloads the Vault Credentials file to a specified location. + + + + + Get + AzureRMBackupVaultCredentials + + + + To enable hybrid backup scenarios the Vault Credentials file is a critical component. The vault credential file is used to connect a server to the Azure Backup vault and register it. Only after registration can backup data be sent to the vault. The Get-AzureRMBackupVaultCredentials commandlet downloads and places a vault credential file at the location specified by the user. + + + + Get-AzureRMBackupVaultCredentials + + TargetLocation + + The destination path where the Vault Credentials file should be placed. + + String + + + Vault + + The specific Azure Backup vault object for which the Vault Credential file is generated. Use the Get-AzureRMBackupVault to get a list of vaults. + + AzureRMBackupVault + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + + + TargetLocation + + The destination path where the Vault Credentials file should be placed. + + String + + String + + + + + + Vault + + The specific Azure Backup vault object for which the Vault Credential file is generated. Use the Get-AzureRMBackupVault to get a list of vaults. + + AzureRMBackupVault + + AzureRMBackupVault + + + + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + AzureProfile + + + + + + + + + AzureRMBackupVault + + + + + +This section details out the type of the objects that you can pipe to the cmdlet. + + + + + + + Vault Credentials file name as [String] + + + + + This section details out the type of the objects that the cmdlet emits. + + + + + + + + + None + + + + + + + + + + + New-AzureRMBackupProtectionPolicy + + Creates a PowerShell object that holds backup policy information + + + + + New + AzureRMBackupProtectionPolicy + + + + A backup policy defines when and how often the backup of an item is done. This commandlet creates a PowerShell object that holds backup policy information. The backup policy is used as an input to the Enable-AzureRMBackupProtection commandlet. + There are 4 types of retention - Daily, Weekly, Monthly, and Yearly. You need to create one object for each type of retention that you plan to use. + + + + New-AzureRMBackupProtectionPolicy + + Name + + The name of the backup policy. It should be unique within a vault. + + String + + + Type + + The type of backup item on which the policy can be applied. Currently, the only supported value for is AzureVM. + + String + + + BackupTime + + The time of the day when backup should be triggered. + + DateTime + + + DaysOfWeek + + Specifies one or more days of the week when backup will be triggered at the time specified using the -BackupTime option. This parameter needs to be used with the -Weekly flag. + + String[] + + + RetentionPolicy + + A list of one or more retention policies that are associated with this backup policy. Use the New-AzureRMBackupRetentionPolicyObject to create retention policies. + + AzureRMBackupRetentionPolicy[] + + + Vault + + The Azure Backup vault that is the parent for the backup policy. + + AzureRMBackupVault + + + Profile + + Non-mandatory AzureProfile input object. + + AzureProfile + + + + New-AzureRMBackupProtectionPolicy + + Name + + The name of the backup policy. It should be unique within a vault. + + String + + + Type + + The type of backup item on which the policy can be applied. Currently, the only supported value for is AzureVM. + + String + + + Daily + + A flag for indicating that the backup policy will be triggered daily. + + SwitchParameter + + + BackupTime + + The time of the day when backup should be triggered. + + DateTime + + + RetentionPolicy + + A list of one or more retention policies that are associated with this backup policy. Use the New-AzureRMBackupRetentionPolicyObject to create retention policies. + + AzureRMBackupRetentionPolicy[] + + + Vault + + The Azure Backup vault that is the parent for the backup policy. + + AzureRMBackupVault + + + Profile + + Non-mandatory AzureProfile input object. + + AzureProfile + + + + New-AzureRMBackupProtectionPolicy + + Name + + The name of the backup policy. It should be unique within a vault. + + String + + + Type + + The type of backup item on which the policy can be applied. Currently, the only supported value for is AzureVM. + + String + + + Weekly + + A flag for indicating that the backup policy will be triggered on one more days of the week. + + SwitchParameter + + + BackupTime + + The time of the day when backup should be triggered. + + DateTime + + + DaysOfWeek + + Specifies one or more days of the week when backup will be triggered at the time specified using the -BackupTime option. This parameter needs to be used with the -Weekly flag. + + String[] + + + RetentionPolicy + + A list of one or more retention policies that are associated with this backup policy. Use the New-AzureRMBackupRetentionPolicyObject to create retention policies. + + AzureRMBackupRetentionPolicy[] + + + Vault + + The Azure Backup vault that is the parent for the backup policy. + + AzureRMBackupVault + + + Profile + + Non-mandatory AzureProfile input object. + + AzureProfile + + + + + + Name + + The name of the backup policy. It should be unique within a vault. + + String + + String + + + + + + Type + + The type of backup item on which the policy can be applied. Currently, the only supported value for is AzureVM. + + String + + String + + + + + + BackupTime + + The time of the day when backup should be triggered. + + DateTime + + DateTime + + + + + + DaysOfWeek + + Specifies one or more days of the week when backup will be triggered at the time specified using the -BackupTime option. This parameter needs to be used with the -Weekly flag. + + String[] + + String[] + + + + + + RetentionPolicy + + A list of one or more retention policies that are associated with this backup policy. Use the New-AzureRMBackupRetentionPolicyObject to create retention policies. + + AzureRMBackupRetentionPolicy[] + + AzureRMBackupRetentionPolicy[] + + + + + + Vault + + The Azure Backup vault that is the parent for the backup policy. + + AzureRMBackupVault + + AzureRMBackupVault + + + + + + Profile + + Non-mandatory AzureProfile input object. + + AzureProfile + + AzureProfile + + + + + + Daily + + A flag for indicating that the backup policy will be triggered daily. + + SwitchParameter + + SwitchParameter + + + + + + Weekly + + A flag for indicating that the backup policy will be triggered on one more days of the week. + + SwitchParameter + + SwitchParameter + + + + + + + + + None + + + + + + + + + + + + + AzureRMBackupProtectionPolicy + + + + + This section details out the type of the objects that the cmdlet emits + + + + + + + + + None + + + + + -------------------------- Create a daily backup policy with daily and monthly retention -------------------------- + + PS C:\> + + $bp = New-AzureRMBackupProtectionPolicy -Name DailyBackup01 -Type AzureVM -Daily -BackupTime ([datetime]"3:30 PM") -RetentionPolicy ($Daily,$Monthly) -Vault $v + + + The backup policy in this example has a daily backup time of 3:00 PM, and the backup data is stored as per the $Daily and $Monthly retention policies created using the New-AzureRMBackupRetentionPolicyObject commandlet. + + + Name Type ScheduleType BackupTime +---- ---- ------------ ---------- +DailyBkp AzureVM Daily 26-Aug-15 3:00:00 PM + + + + + + + + + + + + + New-AzureRMBackupRetentionPolicyObject + + + + Enable-AzureRMBackupProtection + + + + Get-AzureRMBackupProtectionPolicy + + + + Set-AzureRMBackupProtectionPolicy + + + + Remove-AzureRMBackupProtectionPolicy + + + + + + + + New-AzureRMBackupRetentionPolicyObject + + Creates a PowerShell object that holds retention policy information + + + + + New + AzureRMBackupRetentionPolicyObject + + + + A backup policy is associated with at least one retention policy. The retention policy defines how long a recovery point is kept with Azure Backup. This commandlet creates PowerShell objects that hold retention policy information. These retention policy objects are used as inputs to the New-AzureRMBackupProtectionPolicy commandlet, or directly with the Enable-AzureRMBackupProtection commandlet. + There are 4 types of retention - Daily, Weekly, Monthly, and Yearly. You need to create one object for each type of retention that you plan to use. + + + + New-AzureRMBackupRetentionPolicyObject + + DailyRetention + + Switch parameter that creates an object with Daily retention information. + + SwitchParameter + + + Retention + + The retention period for which the backup point will be stored. This unit depends on the switch option specified in the commandlet. For example, if you are using the -DailyRetention flag then this value specifies the retention in days. Or if you are using the -MonthlyRetentionInDailyFormat flag then this value specifies the retention in months. + + Int32 + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + New-AzureRMBackupRetentionPolicyObject + + WeeklyRetention + + Switch parameter that creates an object with Weekly retention information. + + SwitchParameter + + + DaysOfWeek + + The days of the week used to identify which recovery points will be retained and for how long. This parameter works with the -WeeklyRetention, -MonthlyRetentionInWeeklyFormat, and -YearlyRetentionInWeeklyFormat options. + NOTE: You need to ensure that the days of the week that are picked for backup and for retention are aligned! For example, if backup is set for Saturdays then the weekly/monthly/yearly retention policies also must use Saturday as the -DaysOfWeek option. + + String[] + + + Retention + + The retention period for which the backup point will be stored. This unit depends on the switch option specified in the commandlet. For example, if you are using the -DailyRetention flag then this value specifies the retention in days. Or if you are using the -MonthlyRetentionInDailyFormat flag then this value specifies the retention in months. + + Int32 + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + New-AzureRMBackupRetentionPolicyObject + + MonthlyRetentionInDailyFormat + + Switch parameter that creates an object with Monthly retention information. + + SwitchParameter + + + DaysOfMonth + + The days of the month used to identify which recovery points will be retained and for how long. This parameter works with the -DailyRetention, -MonthlyRetentionInDailyFormat, and -YearlyRetentionInDailyFormat options. + + + List`1[String] + + + Retention + + The retention period for which the backup point will be stored. This unit depends on the switch option specified in the commandlet. For example, if you are using the -DailyRetention flag then this value specifies the retention in days. Or if you are using the -MonthlyRetentionInDailyFormat flag then this value specifies the retention in months. + + Int32 + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + New-AzureRMBackupRetentionPolicyObject + + MonthlyRetentionInWeeklyFormat + + Switch parameter that creates an object with Monthly retention information. + + SwitchParameter + + + DaysOfWeek + + The days of the week used to identify which recovery points will be retained and for how long. This parameter works with the -WeeklyRetention, -MonthlyRetentionInWeeklyFormat, and -YearlyRetentionInWeeklyFormat options. + NOTE: You need to ensure that the days of the week that are picked for backup and for retention are aligned! For example, if backup is set for Saturdays then the weekly/monthly/yearly retention policies also must use Saturday as the -DaysOfWeek option. + + String[] + + + WeekNumber + + When defining monthly retention, this parameter specifies which week of the month has the recovery points that should get monthly retention. + + String[] + + + Retention + + The retention period for which the backup point will be stored. This unit depends on the switch option specified in the commandlet. For example, if you are using the -DailyRetention flag then this value specifies the retention in days. Or if you are using the -MonthlyRetentionInDailyFormat flag then this value specifies the retention in months. + + Int32 + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + New-AzureRMBackupRetentionPolicyObject + + YearlyRetentionInDailyFormat + + Switch parameter that creates an object with Yearly retention information. + + SwitchParameter + + + DaysOfMonth + + The days of the month used to identify which recovery points will be retained and for how long. This parameter works with the -DailyRetention, -MonthlyRetentionInDailyFormat, and -YearlyRetentionInDailyFormat options. + + + List`1[String] + + + MonthsOfYear + + When defining yearly retention, this parameter specifies which months of the year has the recovery points that should get yearly retention. + + String[] + + + Retention + + The retention period for which the backup point will be stored. This unit depends on the switch option specified in the commandlet. For example, if you are using the -DailyRetention flag then this value specifies the retention in days. Or if you are using the -MonthlyRetentionInDailyFormat flag then this value specifies the retention in months. + + Int32 + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + New-AzureRMBackupRetentionPolicyObject + + YearlyRetentionInWeeklyFormat + + Switch parameter that creates an object with Yearly retention information. + + SwitchParameter + + + DaysOfWeek + + The days of the week used to identify which recovery points will be retained and for how long. This parameter works with the -WeeklyRetention, -MonthlyRetentionInWeeklyFormat, and -YearlyRetentionInWeeklyFormat options. + NOTE: You need to ensure that the days of the week that are picked for backup and for retention are aligned! For example, if backup is set for Saturdays then the weekly/monthly/yearly retention policies also must use Saturday as the -DaysOfWeek option. + + String[] + + + WeekNumber + + When defining monthly retention, this parameter specifies which week of the month has the recovery points that should get monthly retention. + + String[] + + + MonthsOfYear + + When defining yearly retention, this parameter specifies which months of the year has the recovery points that should get yearly retention. + + String[] + + + Retention + + The retention period for which the backup point will be stored. This unit depends on the switch option specified in the commandlet. For example, if you are using the -DailyRetention flag then this value specifies the retention in days. Or if you are using the -MonthlyRetentionInDailyFormat flag then this value specifies the retention in months. + + Int32 + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + + + DailyRetention + + Switch parameter that creates an object with Daily retention information. + + SwitchParameter + + SwitchParameter + + + + + + Retention + + The retention period for which the backup point will be stored. This unit depends on the switch option specified in the commandlet. For example, if you are using the -DailyRetention flag then this value specifies the retention in days. Or if you are using the -MonthlyRetentionInDailyFormat flag then this value specifies the retention in months. + + Int32 + + Int32 + + + + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + AzureProfile + + + + + + WeeklyRetention + + Switch parameter that creates an object with Weekly retention information. + + SwitchParameter + + SwitchParameter + + + + + + DaysOfWeek + + The days of the week used to identify which recovery points will be retained and for how long. This parameter works with the -WeeklyRetention, -MonthlyRetentionInWeeklyFormat, and -YearlyRetentionInWeeklyFormat options. + NOTE: You need to ensure that the days of the week that are picked for backup and for retention are aligned! For example, if backup is set for Saturdays then the weekly/monthly/yearly retention policies also must use Saturday as the -DaysOfWeek option. + + String[] + + String[] + + + + + + MonthlyRetentionInDailyFormat + + Switch parameter that creates an object with Monthly retention information. + + SwitchParameter + + SwitchParameter + + + + + + DaysOfMonth + + The days of the month used to identify which recovery points will be retained and for how long. This parameter works with the -DailyRetention, -MonthlyRetentionInDailyFormat, and -YearlyRetentionInDailyFormat options. + + + List`1[String] + + List`1[String] + + + + + + MonthlyRetentionInWeeklyFormat + + Switch parameter that creates an object with Monthly retention information. + + SwitchParameter + + SwitchParameter + + + + + + WeekNumber + + When defining monthly retention, this parameter specifies which week of the month has the recovery points that should get monthly retention. + + String[] + + String[] + + + + + + YearlyRetentionInDailyFormat + + Switch parameter that creates an object with Yearly retention information. + + SwitchParameter + + SwitchParameter + + + + + + MonthsOfYear + + When defining yearly retention, this parameter specifies which months of the year has the recovery points that should get yearly retention. + + String[] + + String[] + + + + + + YearlyRetentionInWeeklyFormat + + Switch parameter that creates an object with Yearly retention information. + + SwitchParameter + + SwitchParameter + + + + + + + + + None + + + + + + + + + + + + + AzureRMBackupRetentionPolicy + + + + + This section details out the type of the objects that the cmdlet emits. + + + + + + + + + None + + + + + -------------------------- Create a retention policy for 30 days of daily retention -------------------------- + + PS C:\> + + $Daily = New-AzureRMBackupRetentionPolicyObject -DailyRetention -Retention 30 +PS C:\> $Daily + + + + + RetentionType Retention RetentionTimes +------------- --------- -------------- +Daily 30 + + + + + + + + + + + -------------------------- Create a monthly retention policy -------------------------- + + PS C:\> + + $Monthly = New-AzureRMBackupRetentionPolicyObject -MonthlyRetentionInDailyFormat -DaysOfMonth (10, 20) -Retention 12 +PS C:\> $Monthly | select * + + This policy keeps the backup on the 10th and the 20th of each month for 12 months + + + RetentionFormat : Daily +DaysOfMonth : {10, 20} +WeekNumber : +DaysOfWeek : +RetentionType : Monthly +Retention : 12 +RetentionTimes : + + + + + + + + + + + + + New-AzureRMBackupProtectionPolicy + + + + + + + + New-AzureRMBackupVault + + Creates a new Azure Backup vault based on the parameters that are specified. A vault is the start point for all backup operations with Azure Backup. + + + + + New + AzureRMBackupVault + + + + The New-AzureRMBackupVault commandlet creates and Azure Backup vault and returns an object of type AzurePSBackupVault that acts as a reference to the vault entity. The vault has some important properties that define the scope of backup – the region and the storage type. + + + + New-AzureRMBackupVault + + ResourceGroupName + + Specifies the name of an existing resource group. In order to create a resource group, use the New-AzureResourceGroup commandlet. There is no requirement that the Azure ResourceGroup and the Azure Backup vault be in the same region. + + String + + + Name + + Specifies the name of the Azure Backup vault. The combination of ResourceGroupName and Name must be unique. You cannot create two vaults with the same name under the same ResourceGroup, but two vaults with the same name can be placed under two different Resource Groups. + + String + + + Region + + The region parameter places the vault object into a specific Azure region. For hybrid backup scenarios, it is advised to create a vault in a region close to the on-premise server to reduce latency. For backup of Azure IaaS virtual machines, the vault becomes the point of discovery for local virtual machines. + + String + + + Storage + + Backup storage is billed at Azure Storage rates and users can choose between LocallyRedundant and GeoRedundant as the storage for the backup data. Since this is an optional parameter, if it is not specified then the vault is created with the GeoRedundant Storage option. + + AzureBackupVaultStorageType + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + + + ResourceGroupName + + Specifies the name of an existing resource group. In order to create a resource group, use the New-AzureResourceGroup commandlet. There is no requirement that the Azure ResourceGroup and the Azure Backup vault be in the same region. + + String + + String + + + + + + Name + + Specifies the name of the Azure Backup vault. The combination of ResourceGroupName and Name must be unique. You cannot create two vaults with the same name under the same ResourceGroup, but two vaults with the same name can be placed under two different Resource Groups. + + String + + String + + + + + + Region + + The region parameter places the vault object into a specific Azure region. For hybrid backup scenarios, it is advised to create a vault in a region close to the on-premise server to reduce latency. For backup of Azure IaaS virtual machines, the vault becomes the point of discovery for local virtual machines. + + String + + String + + + + + + Storage + + Backup storage is billed at Azure Storage rates and users can choose between LocallyRedundant and GeoRedundant as the storage for the backup data. Since this is an optional parameter, if it is not specified then the vault is created with the GeoRedundant Storage option. + + AzureBackupVaultStorageType + + AzureBackupVaultStorageType + + + + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + AzureProfile + + + + + + + + + None + + + + + + + + + + + + AzureRMBackupVault + + + + + This section details out the type of the objects that the cmdlet emits. + + + + + + + + + None + + + + + -------------------------- Create a new backup vault -------------------------- + + PS C:\> + + New-AzureRMBackupVault –ResourceGroupName “rg1” –Name “vault1” –Region “westus” + + + + + ResourceId : /subscriptions/4bfbe168-f42a-4a06-8f5a-331cad1f497e/resourceGroups/rg1/providers/Microsoft.Backup + /BackupVault/vault1 +Name : vault1 +ResourceGroupName : rg1 +Region : westus +Storage : GeoRedundant + + + + + + + + + + + -------------------------- Create a new backup vault with Locally Redundant Storage -------------------------- + + PS C:\> + + New-AzureRMBackupVault –ResourceGroupName “rg2” –Name “vault2” –Region “westus” –Storage LocallyRedundant + + + + + ResourceId : /subscriptions/4bfbe168-f42a-4a06-8f5a-331cad1f497e/resourceGroups/rg2/providers/Microsoft.Backup + /BackupVault/vault2 +Name : vault2 +ResourceGroupName : rg2 +Region : westus +Storage : LocallyRedundant + + + + + + + + + + + + + New-AzureResourceGroup + https://msdn.microsoft.com/en-us/library/dn654594.aspx + + + Get-AzureRMBackupVault + + + + Set-AzureRMBackupVault + + + + Remove-AzureRMBackupVault + + + + + + + + Register-AzureRMBackupContainer + + Register the container with the Azure Backup vault + + + + + Register + AzureRMBackupContainer + + + + The first step towards configuring backup with Azure Backup is to register your machine or VM with an Azure Backup vault. This commandlet takes the input information of an Azure IaaS virtual machine and registers it with the specified vault. The register operation associates the Azure virtual machine with the backup vault and tracks the VM through the backup lifecycle. + + + + Register-AzureRMBackupContainer + + Name + + Name of the Azure VM to be registered. + + String + + + ServiceName + + The cloud service name of the Azure VM to be registered. Typically the cloud service name has a suffix ".cloudapp.net". Do not include the suffix as input to this commandlet! You can use the Get-AzureVM commandlet (in the AzureServiceManagement mode) to get the VM information; the service name is the DeploymentName property in the VM object. + + String + + + Vault + + The Azure Backup vault to which the Azure VM should be registered. + + AzureRMBackupVault + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + Register-AzureRMBackupContainer + + Name + + Name of the Azure VM to be registered. + + String + + + ResourceGroupName + + If your VM is created in the AzureResourceManager mode, then instead of -ServiceName you will need to use this parameter + + String + + + Vault + + The Azure Backup vault to which the Azure VM should be registered. + + AzureRMBackupVault + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + + + Name + + Name of the Azure VM to be registered. + + String + + String + + + + + + ServiceName + + The cloud service name of the Azure VM to be registered. Typically the cloud service name has a suffix ".cloudapp.net". Do not include the suffix as input to this commandlet! You can use the Get-AzureVM commandlet (in the AzureServiceManagement mode) to get the VM information; the service name is the DeploymentName property in the VM object. + + String + + String + + + + + + Vault + + The Azure Backup vault to which the Azure VM should be registered. + + AzureRMBackupVault + + AzureRMBackupVault + + + + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + AzureProfile + + + + + + ResourceGroupName + + If your VM is created in the AzureResourceManager mode, then instead of -ServiceName you will need to use this parameter + + String + + String + + + + + + + + + AzureRMBackupVault + + + + + This section details out the type of the objects that you can pipe to the cmdlet. + + + + + + + AzureRMBackupJob + + + + + This section details out the type of the objects that the cmdlet emits. + + + + + + + + + + None + + + + + -------------------------- Register a virtual machine to an Azure Backup vault -------------------------- + + PS C:\> + + $job = Register-AzureRMBackupContainer -Vault $v -Name "testvm" -ServiceName "testvm" + + + + + None + + + + + + + + + + + + + Get-AzureVM + + + + + + + + Remove-AzureRMBackupProtectionPolicy + + Deletes a backup policy from the vault + + + + + Remove + AzureRMBackupProtectionPolicy + + + + Deletes the specified policy from the backup vault. + + + + Remove-AzureRMBackupProtectionPolicy + + ProtectionPolicy + + The protection policy object that has information about the policy. Use the Get-AzureRMBackupProtectionPolicy commandlet to get a list of protection policy objects. + + AzureRMBackupProtectionPolicy + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + + + ProtectionPolicy + + The protection policy object that has information about the policy. Use the Get-AzureRMBackupProtectionPolicy commandlet to get a list of protection policy objects. + + AzureRMBackupProtectionPolicy + + AzureRMBackupProtectionPolicy + + + + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + AzureProfile + + + + + + + + + AzureRMBackupProtectionPolicy + + + + + This section details out the type of the objects that you can pipe to the cmdlet. + + + + + + + + None + + + + + + + + + + + + + + + The policy must not have any associated Items that are protected. If you need to delete the policy, ensure that each associated item is protected with some other policy first. To associate another policy with a backup item, use the Enable-AzureRMBackupProtection commandlet. + + + + + -------------------------- Remove a specified policy -------------------------- + + PS C:\> + + Get-AzureRMBackupProtectionPolicy -Vault $v -Name DailyBackup | Remove-AzureRMBackupProtectionPolicy + + In this example, we fetch a policy named "DailyBackup" and pipe the policy object to the Remove commandlet. + + + None + + + + + + + + + + + + + Get-AzureRMBackupProtectionPolicy + + + + New-AzureRMBackupProtectionPolicy + + + + + + + + Remove-AzureRMBackupVault + + Deletes the Azure Backup vault object based on the parameters that are specified. + + + + + Remove + AzureRMBackupVault + + + + The Remove-AzureBackupVault commandlet deletes the backup vault. However, before a vault can be removed, it must first be empty – it must contain no backup data or protected items or registered servers. This ensures that a vault cannot be deleted inadvertently; the deletion of a backup vault is a planned operation. + Use the Remove-AzureBackupContainer commandlet to clear up IaaS VM backup data from the vault, or use the Delete-RegisteredServer commandlet to clear up other registered servers and backup data. + + + + Remove-AzureRMBackupVault + + Vault + + The specific Azure Backup vault object which needs to be removed. Use the Get-AzureRMBackupVault to get a list of vaults. + + AzureRMBackupVault + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + + + Vault + + The specific Azure Backup vault object which needs to be removed. Use the Get-AzureRMBackupVault to get a list of vaults. + + AzureRMBackupVault + + AzureRMBackupVault + + + + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + AzureProfile + + + + + + + + + AzureRMBackupVault + + + + + This section details out the type of the objects that you can pipe to the cmdlet. + + + + + + + None + + + + + + + + + + + + + + None + + + + + -------------------------- Delete an Azure Backup vault -------------------------- + + PS C:\> + + Get-AzureBackupVault -Name "myvault" | Remove-AzureBackupVault + + + + + + + + + + + + + + + + + + RemoveAzureRMBackupContainer + + + + New-AzureRMBackupVault + + + + Get-AzureRMBackupVault + + + + Set-AzureRMBackupVault + + + + + + + + Restore-AzureRMBackupItem + + Restores the data and config for a point in time + + + + + Restore + AzureRMBackupItem + + + + In order to restore backup data, you need to identify the backed-up item and the recovery point that holds the point-in-time data that needs to be restored. This information is supplied to the Restore-AzureRMBackupItem commandlet to initiate a restore of data from the vault to the customer's account. + + + + Restore-AzureRMBackupItem + + StorageAccountName + + The target storage account name in the customer subscription. As a part of the restore process, the disks and the config information will be placed in this storage account. + + String + + + RecoveryPoint + + The recovery point object that has information about which specific point-in-time needs to be restored. + + AzureRMBackupRecoveryPoint + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + + + StorageAccountName + + The target storage account name in the customer subscription. As a part of the restore process, the disks and the config information will be placed in this storage account. + + String + + String + + + + + + RecoveryPoint + + The recovery point object that has information about which specific point-in-time needs to be restored. + + AzureRMBackupRecoveryPoint + + AzureRMBackupRecoveryPoint + + + + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + AzureProfile + + + + + + + + + AzureRMBackupRecoveryPoint + + + + + This section details out the type of the objects that you can pipe to the cmdlet. + + + + + + + + AzureRMBackupJob + + + + + This section details out the type of the objects that the cmdlet emits. + + + + + + + + + + Triggering a restore operation in PowerShell does not restore the full VM. It restores only the disk data and config information. The user has to additionally create the VM and start it after the restore operation has completed. + + + + + -------------------------- Restore a recovery point -------------------------- + + PS C:\> + + $rp = Get-AzureRMBackupContainer -Type AzureVM -Status Registered -Vault $v | Get-AzureRMBackupItem | Get-AzureRMBackupRecoveryPoint +PS C:\> Restore-AzureRMBackupItem -StorageAccountName "destaccount" -RecoveryPoint $rp + + + + + WorkloadName Operation Status StartTime EndTime +------------ --------- ------ --------- ------- +test-vm Restore InProgress 26-Aug-15 1:14:01 PM 01-Jan-01 12:00:00 AM + + + + + + + + + + + + + + + + + Set-AzureRMBackupProtectionPolicy + + Update an existing protection policy + + + + + Set + AzureRMBackupProtectionPolicy + + + + The protection policy has multiple components: +- Name +- Backup schedule +- Retention policies + This commandlet allows you to update one or more of the components of the policy. The change might affect the backup and retention of the items associated with the policy. + + + + Set-AzureRMBackupProtectionPolicy + + NewName + + An optional parameter that specifies the new name for the policy. As with any policy, this value should be unique within a vault + + String + + + BackupTime + + An optional parameter that specifies the new backup time for the policy. + + DateTime + + + RetentionPolicy + + An optional parameter that specifies one or more new retention policies to be associated with the protection policy. + + AzureRMBackupRetentionPolicy[] + + + ProtectionPolicy + + The protection policy object that refers to the original policy that this commandlet will update. + + AzureRMBackupProtectionPolicy + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + Set-AzureRMBackupProtectionPolicy + + NewName + + An optional parameter that specifies the new name for the policy. As with any policy, this value should be unique within a vault + + String + + + Daily + + An optional parameter that sets the backup operation to run at a Daily schedule. Refer to New-AzureRMBackupProtectionPolicy for examples. + + SwitchParameter + + + BackupTime + + An optional parameter that specifies the new backup time for the policy. + + DateTime + + + RetentionPolicy + + An optional parameter that specifies one or more new retention policies to be associated with the protection policy. + + AzureRMBackupRetentionPolicy[] + + + ProtectionPolicy + + The protection policy object that refers to the original policy that this commandlet will update. + + AzureRMBackupProtectionPolicy + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + Set-AzureRMBackupProtectionPolicy + + NewName + + An optional parameter that specifies the new name for the policy. As with any policy, this value should be unique within a vault + + String + + + Weekly + + An optional parameter that sets the backup operation to run at a Weekly schedule. Refer to New-AzureRMBackupProtectionPolicy for examples. + + SwitchParameter + + + BackupTime + + An optional parameter that specifies the new backup time for the policy. + + DateTime + + + RetentionPolicy + + An optional parameter that specifies one or more new retention policies to be associated with the protection policy. + + AzureRMBackupRetentionPolicy[] + + + DaysOfWeek + + An optional parameter that sets the backup operation to run on specific days of the week. Used in conjunction with the -Weekly parameter. Refer to New-AzureRMBackupProtectionPolicy for examples. + + String[] + + + ProtectionPolicy + + The protection policy object that refers to the original policy that this commandlet will update. + + AzureRMBackupProtectionPolicy + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + + + NewName + + An optional parameter that specifies the new name for the policy. As with any policy, this value should be unique within a vault + + String + + String + + + + + + BackupTime + + An optional parameter that specifies the new backup time for the policy. + + DateTime + + DateTime + + + + + + RetentionPolicy + + An optional parameter that specifies one or more new retention policies to be associated with the protection policy. + + AzureRMBackupRetentionPolicy[] + + AzureRMBackupRetentionPolicy[] + + + + + + ProtectionPolicy + + The protection policy object that refers to the original policy that this commandlet will update. + + AzureRMBackupProtectionPolicy + + AzureRMBackupProtectionPolicy + + + + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + AzureProfile + + + + + + Daily + + An optional parameter that sets the backup operation to run at a Daily schedule. Refer to New-AzureRMBackupProtectionPolicy for examples. + + SwitchParameter + + SwitchParameter + + + + + + Weekly + + An optional parameter that sets the backup operation to run at a Weekly schedule. Refer to New-AzureRMBackupProtectionPolicy for examples. + + SwitchParameter + + SwitchParameter + + + + + + DaysOfWeek + + An optional parameter that sets the backup operation to run on specific days of the week. Used in conjunction with the -Weekly parameter. Refer to New-AzureRMBackupProtectionPolicy for examples. + + String[] + + String[] + + + + + + + + + AzureRMBackupProtectionPolicy + + + + + This section details out the type of the objects that you can pipe to the cmdlet. + + + + + + + None + + + + + + + + + + + + + + + None + + + + + + + New-AzureRMBackupProtectionPolicy @@ -898,30 +4237,36 @@ Storage : LocallyRedundant - Remove-AzureBackupVault + Set-AzureRMBackupVault - Deletes the Azure Backup vault object based on the parameters that are specified. + Changes the properties of the Azure Backup vault object based on the parameters that are specified. - Remove - AzureBackupVault + Set + AzureRMBackupVault - The Remove-AzureBackupVault commandlet deletes the backup vault. However, before a vault can be removed, it must first be empty – it must contain no backup data or protected items or registered servers. This ensures that a vault cannot be deleted inadvertently; the deletion of a backup vault is a planned operation. - Use the Remove-AzureBackupContainer commandlet to clear up IaaS VM backup data from the vault, or use the Delete-RegisteredServer commandlet to clear up other registered servers and backup data. + The Set-AzureBackupVault commandlet allows you to change the storage type of the backup vault. The other parameters like Region, Name, and ResourceGroupName are not editable. - Remove-AzureBackupVault + Set-AzureRMBackupVault + + Storage + + Users can choose between LocallyRedundant and GeoRedundant as the storage for the backup data. + + AzureBackupVaultStorageType + Vault - The specific Azure Backup vault object which needs to be removed. + The specific Azure Backup vault object for which the properties need to be updated. Use the Get-AzureRMBackupVault to get a list of vaults. - AzurePSBackupVault + AzureRMBackupVault Profile @@ -933,14 +4278,26 @@ Storage : LocallyRedundant + + Storage + + Users can choose between LocallyRedundant and GeoRedundant as the storage for the backup data. + + AzureBackupVaultStorageType + + AzureBackupVaultStorageType + + + + Vault - The specific Azure Backup vault object which needs to be removed. + The specific Azure Backup vault object for which the properties need to be updated. Use the Get-AzureRMBackupVault to get a list of vaults. - AzurePSBackupVault + AzureRMBackupVault - AzurePSBackupVault + AzureRMBackupVault @@ -961,13 +4318,12 @@ Storage : LocallyRedundant - Microsoft.Azure.Commands.AzureBackup.Models.AzurePSBackupVault + AzureRMBackupVault - -This section details out the type of the objects that you can pipe to the cmdlet. + This section details out the type of the objects that you can pipe to the cmdlet. @@ -979,8 +4335,7 @@ This section details out the type of the objects that you can pipe to the cmdlet - -This section details out the type of the objects that the cmdlet emits. + @@ -989,16 +4344,16 @@ This section details out the type of the objects that the cmdlet emits. - None + The storage type is locked on the registration of the first server or virtual machine, and cannot be changed afterwards. - -------------------------- Delete an Azure Backup vault -------------------------- + -------------------------- Change the storage for an existing vault -------------------------- PS C:\> - Get-AzureBackupVault -Name "myvault" | Remove-AzureBackupVault + Get-AzureBackupVault –Name “myvault” | Set-AzureBackupVault –Storage LocallyRedundant @@ -1016,23 +4371,15 @@ This section details out the type of the objects that the cmdlet emits. - Remove-AzureBackupContainer - - - - Delete-RegisteredServer - - - - New-AzureBackupVault + New-AzureRMBackupVault - Get-AzureBackupVault + Get-AzureRMBackupVault - Set-AzureBackupVault + Remove-AzureRMBackupVault @@ -1040,36 +4387,57 @@ This section details out the type of the objects that the cmdlet emits. - Set-AzureBackupVault + Stop-AzureRMBackupJob - Changes the properties of the Azure Backup vault object based on the parameters that are specified. + Cancels an ongoing Azure Backup job - Set - AzureBackupVault + Stop + AzureRMBackupJob - The Set-AzureBackupVault commandlet allows you to change the storage type of the backup vault. The other parameters like Region, Name, and ResourceGroupName are not editable. + This commandlet cancels an existing Azure Backup job. This is particularly helpful if the job is taking too long and is blocking other activities. + The types of jobs that can be stopped are: +- Backup +- Restore + All other job types are not cancellable. - Set-AzureBackupVault - - Storage + Stop-AzureRMBackupJob + + Vault - Users can choose between LocallyRedundant and GeoRedundant as the storage for the backup data. + Use the Get-AzureRMBackupVault to get a list of vaults. - AzureBackupVaultStorageType + AzureRMBackupVault - - Vault + + JobID + + The GUID that uniquely identifies a job in the Azure Backup service. Use the Get-AzureRMBackupJob commandlet to get one or more jobs. From the AzureRMBackupJob object, use the InstanceId field for this value. + + String + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + Stop-AzureRMBackupJob + + Job - The specific Azure Backup vault object for which the properties need to be updated. + The job object that contains information about the job. The commandlet will attempt to stop (or cancel) this job. - AzurePSBackupVault + AzureRMBackupJob Profile @@ -1081,26 +4449,26 @@ This section details out the type of the objects that the cmdlet emits. - - Storage + + Vault - Users can choose between LocallyRedundant and GeoRedundant as the storage for the backup data. + Use the Get-AzureRMBackupVault to get a list of vaults. - AzureBackupVaultStorageType + AzureRMBackupVault - AzureBackupVaultStorageType + AzureRMBackupVault - - Vault + + JobID - The specific Azure Backup vault object for which the properties need to be updated. + The GUID that uniquely identifies a job in the Azure Backup service. Use the Get-AzureRMBackupJob commandlet to get one or more jobs. From the AzureRMBackupJob object, use the InstanceId field for this value. - AzurePSBackupVault + String - AzurePSBackupVault + String @@ -1117,11 +4485,23 @@ This section details out the type of the objects that the cmdlet emits. + + Job + + The job object that contains information about the job. The commandlet will attempt to stop (or cancel) this job. + + AzureRMBackupJob + + AzureRMBackupJob + + + + - Microsoft.Azure.Commands.AzureBackup.Models.AzurePSBackupVault + AzureRMBackupJob @@ -1138,7 +4518,7 @@ This section details out the type of the objects that the cmdlet emits. - This section details out the type of the objects that the cmdlet emits. + @@ -1147,16 +4527,17 @@ This section details out the type of the objects that the cmdlet emits. - The storage type is locked on the registration of the first server or virtual machine, and cannot be changed afterwards. + None - -------------------------- Change the storage for an existing vault -------------------------- + -------------------------- Stop a backup job with a job ID -------------------------- PS C:\> - Get-AzureBackupVault –Name “myvault” | Set-AzureBackupVault –Storage LocallyRedundant + $j = Get-AzureRMBackupJob -Vault $v -Operation Backup +PS C:\> Stop-AzureRMBackupJob -Vault $v -JobID $j.InstanceId @@ -1171,30 +4552,34 @@ This section details out the type of the objects that the cmdlet emits. + + -------------------------- Stop all running Restore operations -------------------------- + + PS C:\> + + Get-AzureRMBackupJob -Vault $v -Operation Restore | Stop-AzureRMBackupJob + + In this example, the AzureRMBackupJob objects returned by the Get-AzureRMBackupJob commandlet are piped to the Stop-AzureRMBackupJob commandlet. + + + + + + + + + + + + - - New-AzureBackupVault - - - - Get-AzureBackupVault - - - - Remove-AzureBackupVault - - - - Set-AzureBackupVaultStorageType - - - Unregister-AzureBackupContainer + Unregister-AzureRMBackupContainer Unregisters the specified Windows Server or Azure virtual machine from the Azure Backup vault. @@ -1202,7 +4587,7 @@ This section details out the type of the objects that the cmdlet emits. Unregister - AzureBackupContainer + AzureRMBackupContainer @@ -1210,7 +4595,7 @@ This section details out the type of the objects that the cmdlet emits. - Unregister-AzureBackupContainer + Unregister-AzureRMBackupContainer Force @@ -1223,7 +4608,7 @@ This section details out the type of the objects that the cmdlet emits. The Windows Server or Azure virtual machine that should be unregistered. - AzureBackupContainer + AzureRMBackupContainer Profile @@ -1252,9 +4637,9 @@ This section details out the type of the objects that the cmdlet emits. The Windows Server or Azure virtual machine that should be unregistered. - AzureBackupContainer + AzureRMBackupContainer - AzureBackupContainer + AzureRMBackupContainer @@ -1288,7 +4673,7 @@ This section details out the type of the objects that the cmdlet emits. AzureBackupJob -- For containers of type Windows, the return value is $null +- For containers of type Windows Server, the return value is $null @@ -1352,7 +4737,131 @@ This operation will delete all data in the backup vault that is associated with - Get-AzureBackupContainer + Get-AzureRMBackupContainer + + + + + + + + Wait-AzureRMBackupJob + + Waits for an Azure Backup job to complete + + + + + Wait + AzureRMBackupJob + + + + Long running operations are tracked in the Azure Backup service using jobs. To script out a workflow sequence that involves such a long running operations, the script has to wait for the operation to finish before starting the next one. This commandlet allows the script to pause until the job completes. + Scripting with this commandlet makes the script code simpler with no need to "poll" for the job status. + + + + Wait-AzureRMBackupJob + + Job + + The job object that contains information about the job. The commandlet will wait for this job to complete. + + Object + + + TimeOut + + The maximum time (in seconds) that the commandlet should wait for the job to complete. It is advised that a timeout value should always be specified to prevent infinite waiting. In order to wait 24 hours, set the timeout value to 86400. + + Nullable`1[Int64] + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + + + Job + + The job object that contains information about the job. The commandlet will wait for this job to complete. + + Object + + Object + + + + + + TimeOut + + The maximum time (in seconds) that the commandlet should wait for the job to complete. It is advised that a timeout value should always be specified to prevent infinite waiting. In order to wait 24 hours, set the timeout value to 86400. + + Nullable`1[Int64] + + Nullable`1[Int64] + + + + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + AzureProfile + + + + + + + + + AzureRMBackupJob + + + + + This section details out the type of the objects that you can pipe to the cmdlet. + + + + + + + AzureRMBackupJob object (or) +Array of AzureRMBackupJob objects + + + + + This section details out the type of the objects that the cmdlet emits. + + + + + + + + + + + + + + + + Get-AzureRMBackupJob diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Models/JobObjects.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Models/JobObjects.cs index 89cdff0b87ba..a4b05997e325 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Models/JobObjects.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Models/JobObjects.cs @@ -21,6 +21,7 @@ using Microsoft.Azure.Management.BackupServices; using Microsoft.Azure.Management.BackupServices; using Mgmt = Microsoft.Azure.Management.BackupServices.Models; +using Microsoft.Azure.Commands.AzureBackup.Cmdlets; namespace Microsoft.Azure.Commands.AzureBackup.Models { @@ -52,7 +53,7 @@ public AzureRMBackupJob(AzureRMBackupVault vault, Mgmt.CSMJobProperties serviceJ : base(vault) { this.InstanceId = jobName; - this.WorkloadType = serviceJob.WorkloadType; + this.WorkloadType = AzureBackupJobHelper.GetTypeForPS(serviceJob.WorkloadType); this.WorkloadName = serviceJob.EntityFriendlyName; this.Operation = serviceJob.Operation; this.Status = serviceJob.Status; diff --git a/src/ResourceManager/Compute/Commands.Compute/RemoteDesktop/GetAzureRemoteDesktopFileCommand.cs b/src/ResourceManager/Compute/Commands.Compute/RemoteDesktop/GetAzureRemoteDesktopFileCommand.cs index 258c8c1f7636..046e8f1ccc55 100644 --- a/src/ResourceManager/Compute/Commands.Compute/RemoteDesktop/GetAzureRemoteDesktopFileCommand.cs +++ b/src/ResourceManager/Compute/Commands.Compute/RemoteDesktop/GetAzureRemoteDesktopFileCommand.cs @@ -13,6 +13,7 @@ // ---------------------------------------------------------------------------------- using System; +using System.Diagnostics; using System.IO; using System.Linq; using System.Management.Automation; @@ -46,15 +47,32 @@ public class GetAzureRemoteDesktopFileCommand : VirtualMachineRemoteDesktopBaseC Mandatory = true, Position = 2, ValueFromPipelineByPropertyName = true, - HelpMessage = "Path and name of the output RDP file.")] + HelpMessage = "Path and name of the output RDP file.", + ParameterSetName = "Download")] + [Parameter( + Mandatory = false, + Position = 2, + ValueFromPipelineByPropertyName = true, + HelpMessage = "Path and name of the output RDP file.", + ParameterSetName = "Launch")] [ValidateNotNullOrEmpty] - public string LocalPath { get; set;} + public string LocalPath { get; set; } + + [Parameter( + Mandatory = true, + Position = 3, + HelpMessage = "Start a remote desktop session to the specified role instance.", + ParameterSetName = "Launch")] + public SwitchParameter Launch + { + get; + set; + } public override void ExecuteCmdlet() { base.ExecuteCmdlet(); - ExecuteClientAction(() => { const string fullAddressPrefix = "full address:s:"; @@ -138,11 +156,46 @@ public override void ExecuteCmdlet() } // Write to file - using (var file = new StreamWriter(this.LocalPath)) + string rdpFilePath = this.LocalPath ?? Path.GetTempFileName(); + + using (var file = new StreamWriter(rdpFilePath)) { file.WriteLine(fullAddressPrefix + address + ":" + port); file.WriteLine(promptCredentials); } + + if (Launch.IsPresent) + { + var startInfo = new ProcessStartInfo + { + CreateNoWindow = true, + WindowStyle = ProcessWindowStyle.Hidden + }; + + if (this.LocalPath == null) + { + string scriptGuid = Guid.NewGuid().ToString(); + + string launchRDPScript = Path.GetTempPath() + scriptGuid + ".bat"; + using (var scriptStream = File.OpenWrite(launchRDPScript)) + { + var writer = new StreamWriter(scriptStream); + writer.WriteLine("start /wait mstsc.exe " + rdpFilePath); + writer.WriteLine("del " + rdpFilePath); + writer.WriteLine("del " + launchRDPScript); + writer.Flush(); + } + + startInfo.FileName = launchRDPScript; + } + else + { + startInfo.FileName = "mstsc.exe"; + startInfo.Arguments = rdpFilePath; + } + + Process.Start(startInfo); + } }); }