Before we get started, I wanted to share something that I found whilst testing out the beta releases and RC of Veeam Backup & Replication 9.5 Update 4. I mentioned whilst running my live Veeam DataLabs: Secure Restore at our Velocity sales and partner event that was also part of our 9.5 update 4 launch event that there was a huge influx of new things you could do with Veeam Backup & Replication and PowerShell Cmdlets.

If you want, see for yourself then run the following command this is going to output all of the cmdlets available in Veeam Backup & Replication 9.5 update 4. Note that if you want to compare you need to run this prior to an update to see the comparison.


Add-PSSnapin VeeamPSSnapin

Get-Command | Where-Object{$_.PSSnapin.Name -eq "VeeamPSSnapin"} | Export-Csv -Path "c:\Veeam95Update4.csv"

VBR 9.5 Update 3a PowerShell Cmdlets 564 -> 734 VBR 9.5 Update 4 Cmdlets

New PowerShell Cmdlets (170 NEW)

A snapshot of the new PowerShell cmdlets is shown below in this table. The PowerShell Reference guide is a great place to start if you want to understand what these can do for you in your environment.

If you were to compare the update 3a release to the new update 4 release you will see that before there were 564 cmdlets and now 734. 170 new! That shows the depth of this release.

030519 1409 1

My focus for the Update 4 release has been around Veeam DataLabs Secure and Staged Restore features. This next section will go deeper into the options and scenarios of how to run Secure and Staged Restore via PowerShell during your recoveries.

Veeam DataLabs: Secure Restore

Veeam DataLabs Secure Restore gives us the ability to perform a third-party antivirus scan before continuing a recovery process. The command below highlights the parameters that can be used for Secure Restore while leveraging Instant VM Recovery®. You will find these same parameters under many other restore cmdlets. More information can be found here.


Get-Command Start-VBRInstantRecovery -ShowCommandInfo
030519 1409 2

The script below is an example that I have used to kick off a secure restore within my own lab environment.

This is the script I used for the on-stage demo, in the demo I was using a tiny windows virtual machine that I had infected with the Eicar malware threat. Many antivirus vendors will use this safe virus to perform tests against their systems. I wanted to demonstrate the full force of what Veeam DataLabs: Secure Restore could bring to the recovery process by showing an infected machine. There is no fun showing you something that is clean, I mean anyone can do that.


#Below are the command sets for Secure Restore

$server= Get-VBRServer -Name tpm01-112.aperaturelabs.biz
$rp = Find-VBRViResourcePool -Server $server -Name TPM04-MC
$b = Get-VBRBackup -Name "Backup Job - Secure Restore"
$rr = Get-VBRRestorePoint -Backup $b | Sort-Object –Property CreationTime –Descending | Select -First 1
$r = $rr[0]
$ds = Find-VBRViDatastore -server $server -name "SolidFireSWING002"
$cred = Get-VBRCredentials -name "minwinpc\administrator"

Start-VBRInstantRecovery -RestorePoint $r -Server $server -VMName "TPM04-SecureRestore-01-Demo" -ResourcePool $rp -Datastore $ds -EnableAntivirusScan -VirusDetectionAction DisableNetwork -Powerup

Veeam DataLabs: Staged Restore

Veeam DataLabs Staged Restore allows for us to inject a script or think a process into an entire VM recovery process, many use cases will be shared, and this is not the place to go into that detail. The command below highlights the parameters available for Staged Restore functionality during a full VM failover.

The one-use case I will share and have had discussions about this since the release is the ability to mask data to departments. The challenge one of our customers was facing was the ability to take their backup data and pre-update 4 they were restoring that data to an isolated environment away from production for their developers to work on. The mention of Veeam DataLabs: Staged Restore allowed them to recognise that the databases they were exposing from these backup files to their development team would also be including sensitive data. With Staged Restore they can inject a script into the process that would exclude that sensitive data from the development team. More information can be found here.


Get-Command Start-VBRRestoreVM -ShowCommandInfo
030519 1409 3

Finally, the script below is another example but this time for Staged Restore. You will note that I have three options at the end that allow for different outcomes. The first option is a standard no staged restore entire VM recovery. The second option (the one that is not hashed out) is the one that will allow us to inject a script without the requirement of an application group. The third and final script example will allow us to leverage an Application Group where the VM we are restoring may require something from a dependency within the Application Group to complete the injection of the script.


#Below are the command sets for Staged Restore

$point = Get-VBRBackup -name "Backup Only Job" | Get-VBRRestorePoint -Name "TPM04-MGMT-01" | Sort-Object –Property CreationTime –Descending | Select -First 1
$server= Get-VBRServer -Name tpm01-112.aperaturelabs.biz
$rp = Find-VBRViEntity -Name TPM04-MC
$ds = Find-VBRViDatastore -server $server -name "SolidFireSWING002"
$folder = Find-VBRViFolder -server $server -name "TPM04-MC"

$cred = Get-VBRCredentials -name "TPM04-MGMT-01\administrator"
$vlab = Get-VSBVirtualLab -Name "TPM04-DataLab-03"
$options = $options = New-VBRApplicationGroupStartupOptions -MaximumBootTime 100 -ApplicationInitializationTimeout 100 -MemoryAllocationPercent 200
$appgroup = Get-VSBApplicationGroup

#Start-VBRRestoreVM -RestorePoint $point -Server $server -ResourcePool $rp -Datastore $ds -Folder $folder -VMName "TPM04-MGMT-01-NoScriptRestore" -Reason "Normal Entire VM Recovery"

Start-VBRRestoreVM -RestorePoint $point -Server $server -ResourcePool $rp -Datastore $ds -Folder $folder -VMName "TPM04-MGMT-01-NoAppGroup" -Reason "Staged Restore Demo No Application Group Required" -EnableStagedRestore -StagingScript "C:\Users\admin-michaelcade\Desktop\Simple_StagedRestoreScript.ps1" -StagingCredentials $cred -StagingVirtualLab $vlab -StagingStartupOptions $options

#Start-VBRRestoreVM -RestorePoint $point -Server $server -ResourcePool $rp -Datastore $ds -Folder $folder -VMName "TPM04-MGMT-01_AppGroupEnabled" -diskType Thin -Reason "Staged Restore Demo Application Group Required" -EnableStagedRestore -StagingScript "C:\Users\admin-michaelcade\Desktop\Simple_StagedRestoreScript.ps" -StagingCredentials $cred -StagingVirtualLab $vlab -StagingApplicationGroup $appgroup -StagingStartupOptions $options

Hopefully that was useful, and I am hoping to explore more PowerShell options especially around the Veeam DataLabs and the art of the possible when it comes to leveraging that data or providing even more additional value above the backup and recovery of your data.

Leave a Reply

Your email address will not be published. Required fields are marked *