question

DnyaneshwarSurywanshi-3200 avatar image
0 Votes"
DnyaneshwarSurywanshi-3200 asked ·

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

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-machinesazure-virtual-machines-extension
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@DnyaneshwarSurywanshi-3200
Please 'Accept as answer' if the provided information is helpful, so that it can help others in the community looking for help on similar topics.

0 Votes 0 ·

1 Answer

shivapatpi-MSFT avatar image
0 Votes"
shivapatpi-MSFT answered ·

Hello @DnyaneshwarSurywanshi-3200 ,
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://docs.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://docs.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"

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.