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.
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.
Running Add-PSSnapin VeeamPSSnapIn will load snapin to PowerShell console.
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
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
We can perform Set operation on our repository like for example change a name to something more friendly
And we can remove repository by running Remove-VBRBackupRepository
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
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
Nex post we will create a backup job.