Académique Documents
Professionnel Documents
Culture Documents
In the first part of the article we learned what PowerShell is, when we should consider using it, and how to use basic Helpful resources:
PowerShell cmdlets. This part contains practical examples of Hyper-V backup and recovery-related operations using
PowerShell scripts with Veeam. Top 10 features for IT Pros in
Windows Server 2012 (R2) that
What is Veeam Backup PowerShell snap-in? seem to be unknown or
unloved
Since v5, Veeam Backup & Replication has had a built-in PowerShell snap-in (a package of cmdlets) that can make your
life as a backup administrator much easier. Veeam PowerShell snap-in provides a set of its own available commands,
Managing Hyper-V with
which correlate with actions that the administrator can perform in the Veeam Backup & Replication GUI. Theres no
Windows PowerShell
limit to the list of available operations; it all depends only on the administrators creativity!
Thinking about killing routine or willing to have a few one-line cmdlets handy, so you can quickly check backup
Getting stuff done with
information right from the console? Either way, this Veeam snap-in is worth knowing.
PowerShell
NOTE: All actions performed with PowerShell have the same impact as actions performed with the Veeam GUI. Once
you make a change, the change is applied to the Veeam Backup database and you may not be able undo it.
Subscribeforupdates
Getting started with Veeam PowerShell snap-in
Enteryourcorporateemail
Veeam requires PowerShell version 2.0 and newer, which should be safe for Windows Server 2008 R2 and later
releases. For older OS versions, check this manual.
SUBSCRIBE
Open the Veeam console and navigate to the main menu. Since Veeam PowerShell snap-in isnt installed by default, you
might not be able to see an available PowerShell option as shown in the figure below.
https://hyperv.veeam.com/blog/howtouseveeampowershellsnapinhypervbackup/ 1/6
16/3/2016 UsingVeeamPowerShellSnapinforHyperVbackup
We keep
Close theworking on bringing
Veeam Backup the most
& Replication console
interesting HyperV topics to you.
Would you please help us and suggest to the system
Put the Veeam installation disk (.iso) back
one? with the guidelines from this KB article
Modify the installation
Now you should be able to find PowerShell in the main menu and launch it.
SEND
This is a special PowerShell toolkit window with the loaded Veeam snap-in. The advantage of using it is that you wont
have to add Veeam snap-in every time youre executing the command, and some predefined cmdlets like Get-
VBRCommand are available. Toolkit is especially helpful when youd like to check something very quickly one-line
query rather than writing scripts.
Since Im about to write some scripts, Ill still be using Windows PowerShell ISE editor. Dont forget to use Add-PSSnapin
VeeamPSSnapin or asnp VeeamPSSnapin (asnp is an alias for Add-PSSnapin) command to add Veeam snap-in and click
the Refresh button so you can see that the PowerShell cmdlets available for Veeam operations.
NOTE: VBR stands for Veeam Backup & Replication, VSB stands for Veeam SureBackup and HV stands for Hyper-V.
It might be quite handy to check a list of VMs on any Hyper-V host added to Veeam console so we can do any operation
with a desired VM. Filter cmdlets by find and locate the cmdlet you need Find-VBRHvEntity. Once you click on it, you
see additional parameters available. Fill them in, execute the command and see how it looks properly:
FindVBRHvEntityName*Serverlocalhost
Obviously, this is too much information to show, which is why you can apply a condition to this output: place a pipe and
add Select-Object Name, Type in order to list only names of VMs and hosts.
https://hyperv.veeam.com/blog/howtouseveeampowershellsnapinhypervbackup/ 2/6
16/3/2016 UsingVeeamPowerShellSnapinforHyperVbackup
Now, we can use this information to perform a quick backup of a Hyper-V VM, aka VeeamZIP. For this purpose, we
should define a variable of Hyper-V object, which is done by using the name of VM. Then we complement this with the
Start-VBRZip cmdlet, as seen below:
Put it together, execute (F5) and see how Veeam is taking the VeeamZIP backup of a Hyper-V VM onto the default
backup repository (C:\backup).
You can open the Veeam console and find the same operation in the GUI:
https://hyperv.veeam.com/blog/howtouseveeampowershellsnapinhypervbackup/ 3/6
16/3/2016 UsingVeeamPowerShellSnapinforHyperVbackup
Note: The Start-VBRZip cmdlet is supported starting from Veeam Backup Free Edition 8.0 Update 2 and is not supported
on previous versions.
Now that we have a backup of a VM, we can restore it back to the server. Find a restore script below. Its better to read
through it from the bottom so you can understand the logic behind all variables.
Execute it and get Hyper-V VM files to be restored from the latest backup point to local server.
https://hyperv.veeam.com/blog/howtouseveeampowershellsnapinhypervbackup/ 4/6
16/3/2016 UsingVeeamPowerShellSnapinforHyperVbackup
Even though, it was rather simple examples of how you can utilize PowerShell for Hyper-V backup and restore tasks, I
hope it was helpful and that it was a good starting point for your PowerShell journey. Now that youve had some
practice, feel free to practice more and check out the following resources:
Have a good time with PowerShell, and dont forget to share your experience with us.
See also
https://hyperv.veeam.com/blog/howtouseveeampowershellsnapinhypervbackup/ 5/6
16/3/2016 UsingVeeamPowerShellSnapinforHyperVbackup
About the author
Andrew Zhelezko is a Veeam Technical Marketing Specialist who gained a strong understanding of Veeam products by working
initially in Veeam technical support. This practical experience has helped him speak the same language as Veeam community
members. His goal is to help others realize the beauty and power of virtualization. Follow Andrew on Google+ and Spiceworks.
0Comments VeeamHyperVblog
1 Login
Startthediscussion
Bethefirsttocomment.
ALSOONVEEAMHYPERVBLOG WHAT'STHIS?
HowtobecomeaMicrosoftCertifiedExpert,Part1 WhatisMicrosoftHyperVvirtualizationtechnology?
6commentsayearago 20commentsayearago
JosephRobertSmithMTAexamsdonotqualifyforMCP AndrewZhelezkoIdon'tthinkIfollowyouhere.Duetodrastic
certification,noraretheyaprerequisiteforMCSAorMCSE differencebetweenthose2platforms,I'dimaginethatthesteps
certification. won'tbecommonatall.Eitherway,it'sbettertomakea
UnderstandingWS2012R2virtualizationrights HowtoconfigureHyperVVirtualSwitch
18commentsayearago 8comments8monthsago
JooJooFrommyunderstanding,ifusingHyperVWS2012 WHHiAndrew...noluckwithSetVMNetworkAdapter.butI
R2STD1HyperVHost,2VMsWS2012R2DC1HyperV eventuallysucceededthismorningusingSet
Host,UnlimitedVM(CPUcapdependingonthelicenseu VMNetworkAdapterVlan....initiallythecmdletkeptfailing
FREE BACKUP TRIAL FREE BACKUP DOWNLOAD PRICING RESOURCES BLOG WHY VEEAM CONTACT US
https://hyperv.veeam.com/blog/howtouseveeampowershellsnapinhypervbackup/ 6/6