Help Center
Choose product document...
Veeam Backup & Replication 9.5
PowerShell Reference

New-VBRJobScriptOptions

Short Description

Creates new job script options.

Applies to

Platform: VMware, Hyper-V

Product Edition: Standard, Enterprise, Enterprise Plus

Syntax

New-VBRJobScriptOptions [-PreScriptEnabled] [-PreCommand <string>] [-PostScriptEnabled] [-PostCommand <string>] [-Day <DayOfWeek[]> {Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday}] [-Periodicity <VBRPeriodicityType> {Cycles | Days}] [-Frequency <uint32>]  [<CommonParameters>]

Detailed Description

This cmdlet creates an object containing pre-job and post-job script settings for backup or replication jobs. You can use this object later to apply these settings to a job.

Parameters

Parameter

Description

Required

Position

Accept
Pipeline
Input

Accept
Wildcard
Characters

PreScript
Enabled

Indicates that you want to run a script before the job.

Use the PreCommand parameter to set the path to the script.

False

Named

False

False

PreCommand

Specifies the path to the pre-job script.

False

Named

False

False

PostScript
Enabled

Indicates that you want to run a script after the job.

Use the PostCommand parameter to set the path to the script.

False

Named

False

False

PostCommand

Specifies the path to the post-job script.

False

Named

False

False

Periodicity

Specifies the script run mode:

  • Cycles - to run a script after a set number of backup sessions.
  • Days - to run a script on the selected days.

Use the Day and Frequency parameters to set the values.

False

Named

False

False

Day

For the days mode.

Specifies the days of week when the script will run.

Default: Saturday.

False

Named

False

False

Frequency

For the cycles mode.

Specifies the number of backup sessions after which the script must run.

Default:1 backup session.

False

Named

False

False

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information about common parameters, see http://go.microsoft.com/fwlink/p/?LinkID=113216.

Return Type

VBRJobScriptOptions

Example

This example shows how to configure job script options. Veeam Backup & Replication will run the scripts on Mondays before and after the job.

PS C:\PS> $scriptoptions = New-VBRJobScriptOptions -PreScriptEnabled -PreCommand "C:\scripts\pre-script.bat" -PostScriptEnabled -PostCommand "C:\scripts\post-script.bat" -Periodicity Day -Day Monday

Veeam Large Logo

User Guide for VMware vSphere

User Guide for Microsoft Hyper-V

Enterprise Manager User Guide

Veeam Cloud Connect Guide

Veeam Agent Management Guide

Veeam Backup Explorers User Guide

PowerShell Reference

RESTful API Reference

Veeam Backup FREE Edition User Guide

Veeam Backup for Microsoft Office 365

Veeam ONE Documentation

Veeam Agent for Windows Documentation

Veeam Agent for Linux Documentation

Veeam Management Pack Documentation