Veeam Home | Support | Downloads
Veeam Backup & Replication 8.0 PowerShell Reference

Veeam Backup & Replication Help Center  > Reference > Getting Started

Getting Started

Next page Print this Topic

Table of contents

Veeam Backup & Replication comes with PowerShell extension — a snap-in to Microsoft Windows PowerShell 2.0. Windows PowerShell is a powerful command-line tool that allows administrators to automate some Veeam Backup & Replication activities. Veeam extends functionality of Windows PowerShell 2.0, and now administrators may use PowerShell to automate Veeam backup, replication and copy job creation and editing, VMs restores, replica failover and other operations.

Before installing Veeam PowerShell snap-in, make sure that Microsoft Windows PowerShell 2.0 is installed on the Veeam Backup & Replication console. To download Microsoft Windows PowerShell, use the following link: http://support.microsoft.com/kb/968929.

To open Veeam PowerShell, select PowerShell in the Veeam Backup & Replication main menu.

PowerShell uses cmdlets — simple single-function commands that can be run in the command-line shell. Cmdlets are specialized .NET classes that implement specific actions. Veeam PowerShell provides a set of its own cmdlets which correspond to actions you can perform via Veeam Backup & Replication UI. Please keep in mind that actions performed with PowerShell have the same force as actions performed via Veeam Backup & Replication (for example, if you delete some job with PowerShell scripts, the job will be removed from the Veeam Backup & Replication database, and you will not be able undo changes).

note

NOTE:

Veeam Support team does not write PowerShell scripts on demand.

Working with Veeam PowerShell cmdlets and scripts in many respects depends on your imagination, skills and expertise in Windows PowerShell 2.0. To learn more about Windows PowerShell 2.0 and its basics, use the book by Dr. Tobias Weltner: Microsoft Master-PowerShell.

The cmdlets operate with objects which they can accept and return. Every object has properties describing it, and methods that can be performed on it.

For example, the Get-VBRJob cmdlet has the following output:

getting_started_1

You can filter and sort results at your discretion using the Where and Sort commands (to learn more about these commands, please refer to Windows PowerShell documentation).

PS C:\PS> Get-VBRJob | Where {$_.Name -eq "Backup Job 3"}

Job Name

 

Type

State

Last Result

Description

Backup Job 3

Hyper-V Backup

Stopped

Success

Created by...

 

 

The result of filtering and sorting can be saved to a variable:

PS C:\PS> $job = Get-VBRJob | Where {$_.Name -eq "Backup Job 3"}

PS C:\PS> $job

Job Name

 

Type

State

Last Result

Description

Backup Job 3

Hyper-V Backup

Stopped

Success

Created by...

 

 

You can get detailed information about the object:

PS C:\PS> $job | gm

  TypeName: Veeam.Backup.Core.CBackupJob

Name

 

MemberType

 

Definition

 

CanRunByScheduler

Delete

DisableScheduler

EnableScheduler

Equals

FindInitialRepository

FindLastSession

FindSourceWanAccelerator

FindTargetRepository

FindTargetWanAccelerator

GetHashCode

GetHvOijs

GetInitialRepository

GetLastResult

GetLastState

GetObjectsInJob

GetOptions

GetProxy

GetScheduleOptions

GetSourceOffHostHvProxies

GetSourceViProxies

GetSourceWanAccelerator

GetTargetHost

GetTargetOffhostHvProxies

GetTargetProxies

GetTargetRepository

GetTargetViProxies

GetTargetWanAccelerator

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

Method

bool ISchedulableJob...

void Delete()

void DisableScheduler()

void EnableScheduler()

bool Equals(System...

Veeam.Backup.Core...

Veeam.Backup.Core...

Veeam.Backup.Core...

Veeam.Backup.Core...

Veeam.Backup.Core...

int GetHashCode()

Veeam.Backup.Core...

Veeam.Backup.Core...

Veeam.Backup.Model...

Veeam.Backup.Model...

Veeam.Backup.Core...

Veeam.Backup.Model...

System.Collections...

Veeam.Backup.Model...

Veeam.Backup.Core...

Veeam.Backup.Core...

Veeam.Backup.Core...

Veeam.Backup.Core...

Veeam.Backup.Core...

System.Collections...

Veeam.Backup.Core...

Veeam.Backup.Core...

Veeam.Backup.Core...

 

And call a method or a property of the object, for example, view last session results.

note

NOTE:

Since Veeam Backup & Replication v5 and v6 use Windows PowerShell 2.0, scripts that you have created with previous versions of Veeam Backup & Replication which used Windows PowerShell 1.0 may not work.

See Next:

Examples of Use

PowerShell Remoting

Interactive PowerShell Help

Table of contents