How to Configuring the backup schedule for VM using MARS agent with Powershell ?

Dnyaneshwar Surywanshi 156 Reputation points
2021-03-01T08:12:12.967+00:00

Below command I am using :

$NewPolicy = New-OBPolicy
$Schedule = New-OBSchedule -DaysOfWeek Saturday, Sunday -TimesOfDay 16:00
$RetentionPolicy = New-OBRetentionPolicy -RetentionDays 7
Set-OBRetentionPolicy -Policy $NewPolicy -RetentionPolicy $RetentionPolicy

But getting error "The term 'Set-OBPolicy' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again."

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,365 questions
{count} votes

1 answer

Sort by: Most helpful
  1. shiva patpi 13,156 Reputation points Microsoft Employee
    2021-03-03T04:28:42.953+00:00

    Hello @Dnyaneshwar Surywanshi ,
    Thanks for your query. The error message indicates the corresponding modules are not installed.

    Those PowerShell Cmdlets are available when you install MARS Agent.
    Try to download the installer from here https://learn.microsoft.com/en-us/azure/backup/install-mars-agent#download-the-mars-agent

    Once MARS Agent gets installed in the default folder on the machine , now open the PowerShell prompt and run the commands.

    Additional references:
    https://learn.microsoft.com/en-us/powershell/msonlinebackup/overview?view=msonlinebackup-ps
    https://itproguru.com/expert/2014/01/inside-windows-azure-online-backup-using-powershell-step-by-step/

    If the above information helps , make sure to "Upvote and Accept the answer"

    0 comments No comments