Manage Veeam v9.5 Server with PowerShell

Manage Veeam v9.5 Server with PowerShell

We can manage Veeam server with PowerShell, to do that first we need to install Veeam management Console on Workstation from which we want to manage the backup server. PowerShell snapin will be installed by default, we don’t need to select anything during installation, Veeam requires PowerShell version 2 minimum.

untitled

Veeam Backup & Replication Console installation

console

Veeam system configuration check

After installation, we can open Veeam PowerShell directly from Backup Console, from the drop-down menu choose Console > PowerShell. PowerShell console will be open and PSSnapin automatically added. We can manually load the PSSnapin to different PowerShell console or ISE console.

powershell

PowerShell Console opening from Veeam

powershell1

PowerShell console with preloaded snapin

Running Add-PSSnapin VeeamPSSnapIn will load snapin to PowerShell console.

powershell2

Manually loading Veeam PSSnapin

Veeam PowerShell Snapin contains 454 commands which we can list by using Get-VBRCommand, we can manage all aspect of Veeam Backup Server.

As my Lab Veeam Backup server is freshly setup Repository, connect to the vCenter server and create the first job. The first command we need to run is Connect-VBRServer -Server Labveeam01

backupserver

Connecting to Veeam Backup Server

Next, we need to add backup repository to store our backup files Add-VBRBackupRepository -Folder FolderPath -Description description -Type WinLocal will create local repository in this case on Veeam Backup server local drive

backuprepo

Creating Backup Repo

We can perform Set operation on our repository like for example change a name to something more friendly

backuprepo1

Changing repository name

And we can remove repository by running Remove-VBRBackupRepository

backuprepo2

Removing repository

Next step will be to add our backup source, in my lab I will use vCenter. Before we add source we have to add a credential to be able to manage the vCenter server. Running command Add-VBRCredential and specifying name, password, and description we will add existing user form vCenter Server

cred

Commands to manage credential on Veeam Server

cred1

List of default credentials

cred2

Adding new credential for vCenter Server

cred3

Removing credential

 

Now we can add vCenter server to Veeam Backup Server. Veeam PSSnapin includes two commands to work with vCenter Add and Set, we will use Add-VBRvCenter. We need to specify hostname and credentials created in the previous step which I have stored in variable $VCCred by running command Get-VBRCredentials

vcenter.JPG

vCenter commands

vcenter1.jpg

Adding vCenter server

 

Nex post we will create a backup job.

Advertisements