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

Dnyaneshwar Surywanshi 156 Reputation points

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

    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

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

    Additional references:

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

    0 comments No comments