42 thoughts on “Scheduling Veeam Backup Free Edition backups

  1. Hallo i have a little Problem with you script. I always get the error Message: Start-VBRZip : Cannot validate argument on parameter ‘Entity’. The argument is null. Provide a valid value for the argument, and then try running the command again.

    I took the Name of the VM that i see in the hyper-v manager under Virtual mashines an took one of these. Is this the wrong name ?

    Thanks for your help Stephan

    1. Hi Stephan – thanks for the comment…

      The script has been written with vSphere in mind but can easily be modified to support Hyper-V…

      Line 11 which reads
      $vmentity = Find-VBRViEntity -Name $VM
      could essentially be switched to support the Hyper-V entity by replacing it with
      $vmentity = Find-VBRHvEntity -Name $VM

      Easy as that – should go for you after switching…

      Thanks,
      Mike

  2. Hi!

    I’ve a problem about Update 2 and VBRZip use.
    When I try to execute the script, I receive always this error:

    Start-VBRZip : License is not installed.
    At C:VeeamZIPStartZip.ps1:24 char:5
    + Start-VBRZip -Entity $vmentity -Folder $destination -Compression $Compressio …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Start-VBRZip], CLicenseNotInstalledException
    + FullyQualifiedErrorId: Veeam.Backup.LicenseLib.CLicenseNotInstalledException,Veeam.Backup.PowerShell.Commands.

    I’ve installed Update 2 last week, but it seems to not working.
    Do you have some advice?
    Thanks in advance.

    1. Same problem here, running Backup 8 Free with Update 2:

      Start-VBRZip : License is not installed.
      At C:scriptstest.ps1:24 char:17
      + Start-VBRZip <<<< -Entity $vmentity -Folder $destination -Compression $C
      ompression -AutoDelete $Autodelete -DisableQuiesce
      + CategoryInfo : NotSpecified: (:) [Start-VBRZip], CLicenseNotIns
      talledException
      + FullyQualifiedErrorId : Veeam.Backup.LicenseLib.CLicenseNotInstalledExce
      ption,Veeam.Backup.PowerShell.Commands.Backup.StartVBRZip

          1. Ha Ha I was coming back here to say the same thing! Update 2b fixes the license issue for sure.

  3. Hmm, was there an option to install powershell components as well with Update 2 – wondering if maybe they didn’t get upgraded as it has all worked from my end…

  4. No idea. I’m using your interactive script via powershell, but when I put all the requested parameters, after a few seconds I receive this error.
    I’ve the 8.0.0.2021 release, so I think the Update 2 has correctly installed.

  5. Ok, found the problem. I was not using the Veeam Powershell in order to test your script. Now, using the Powershell inside Veeam menu, appears to work.
    Thanks.

  6. Should line 12 (if ($vm -eq $null)) not be: if ($vmentity -eq $null) ???

    However the Find-VBRViEntity -Name “HyperV-VM” is not returning any entity ???

    1. You have to update the command to Find-VBRHvEntity.
      The commands are Virtualisation platform specific.

  7. Maybe I’m just a moron, I know very little about powershell. I’m trying to run this script but there’s something wrong with what I’m doing.

    My destination is a nested folder on a network share that works when I run the backups from the GUI, but is failing when it is the destination of the script.

    6/11/2015 11:09:56 AM :: Error: Access is denied.

    Cannot create folder. Folder path: [\serversharethursday].

    –tr:FC: Failed to create directory. Directory path: [\serversharethursday].

    –tr:Failed to call DoRpc. CmdName: [FcCreateDir].

    Access is denied.

    Cannot create folder. Folder path: [\serversharethursday].

    This folder already exists, and again works fine when targeted within the GUI. Any advice?

    1. I had the same problem. I’m not sure, but I do belive that it is the local service (not your user-account) who runs the zip-backup and that’s why there i no access to network-share. I solved this by setting up a share without password-requirements (in DMZ of cource).

  8. I’m running Veeam FREE edition with Update 2b (8.0.0.2030) on Windows 2012 R2 64bit and I still get the error of “Start-VBZip: Veeam Backup Free Edition does not allow VeeamZIP of multiple VMs. Specify a single VM, or install a paid product license.” Anyone know how to fix this?

    1. So apparently backing up the Virtual Center VM throws that error message, is there any way around it? I’m able to backup all other VMs without any problem.

  9. I could not get this to work. Simply running “PS C:Program FilesVeeamBackup and ReplicationBackup> .Initialize-VeeamToolkit.ps1” produces this

    Exception calling “GetAssemblyName” with “1” argument(s): “Could not load file or assembly

    ‘Veeam.Backup.PowerShell.dll’ or one of its dependencies. The system cannot find the file specified.”

    At C:Program FilesVeeamBackup and ReplicationBackupInitialize-VeeamToolkit.ps1:13 char:2

    + $arch = [reflection.assemblyname]::GetAssemblyName($currentExecutingPath).Proce …

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : FileNotFoundException

    Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 3.

    At C:Program FilesVeeamBackup and ReplicationBackupInitialize-VeeamToolkit.ps1:137 char:1

    + Add-PSSnapin VeeamPSSnapIn

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo : InvalidArgument: (VeeamPSSnapIn:String) [Add-PSSnapin], PSArgumentException

    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

    Get-PSSnapIn : No Windows PowerShell snap-ins matching the pattern ‘VeeamPSSnapIn’ were found. Check the pattern and

    then try the command again.

    At C:Program FilesVeeamBackup and ReplicationBackupInitialize-VeeamToolkit.ps1:140 char:11

    + $snapIn = Get-PSSnapIn “VeeamPSSnapIn”

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo : InvalidArgument: (VeeamPSSnapIn:String) [Get-PSSnapin], PSArgumentException

    + FullyQualifiedErrorId : NoPSSnapInsFound,Microsoft.PowerShell.Commands.GetPSSnapinCommand

    update-formatdata : Cannot find path ‘C:Program FilesVeeamBackup and

    ReplicationBackupVeeam.Backup.PowerShell.format.ps1xml’ because it does not exist.

    At C:Program FilesVeeamBackup and ReplicationBackupInitialize-VeeamToolkit.ps1:142 char:1

    + update-formatdata -prependPath $xmlFilePath

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo : InvalidOperation: (Veeam.Backup.PowerShell.format.ps1xml:String) [Update-FormatData], It

    emNotFoundException

    + FullyQualifiedErrorId : FormatPrependPathException,Microsoft.PowerShell.Commands.UpdateFormatDataCommand

    1. I have installed PowerShell 3.0 and Update 2b and there simply isn’t a “Veeam.Backup.PowerShell.dll” installed on my Win 2008 R2 server

    2. I think I have fixed this you need to install “VeeamBackup&Replication.8.0.0.817BackupBPS_x64,msi”

  10. Is there any way to backup all VM’s rather than specifying a specific VM ? I can create multiple scheduled jobs specifying each VM but would be nice if it automatically backed up VM’s that had been created on the host. Just about to have a look at the Veeamtoolkit.ps1 file to see what it does….

    1. (get-vm -ComputerName YOURSERVERFQDN | foreach { $_.Name }) -join “",“” | Tee-Object -Variable VMNames | Out-Null

      $VMNames = “"" + $VMNames + "“”

  11. Great Script, just have one question. I have tried to add multiple email addresses by using “job.bloggs@abc.com”,”john.doe@here.com”…. however only the first recipient is getting the mail. Am I doing something wrong?

  12. TIP: If you just want to backup ALL your machines without giving names, use this instead of $VMNAMES= “A”,”B”,”C”

    (get-vm -ComputerName YOURSERVERFQDN | foreach { $_.Name }) -join “",“” | Tee-Object -Variable VMNames | Out-Null

    $VMNames = “"" + $VMNames + "“”

    1. That’s exactly what I want, but I have no experience with powershell. Where do you put this? I suppose it has to go into some loop?

  13. To be honest after messing about with various backup scripts and powershell, PowerCli, etc this is the most straightforward and logical solution. Nice one Cheers

  14. question… what version of Veeam B&R are you running to do this I have been trying and it will not backup with version 8

  15. Pingback: Anonymous
  16. Tetzschner is correct. This script currently only works with VMWare. and line 12 should read as he listed.
    Starting with the corrected line 12 and ending with line 13 add the below to make this work with VMWare and Hyper-V

    if ($vmentity -eq $null)
    {
    $vmentity = Find-VBRHvEntity -Name $VM
    }
    if ($vmentity -eq $null)
    {
    Write-Host “VM: $VM not found” -ForegroundColor “red”
    exit
    }

  17. For the life of me I cannot get the script to save to a UNC path.

    [03.03.2016 13:29:26] Error Access is denied. in c++: Error code: 0x00000005
    [03.03.2016 13:29:26] Error in c++: Failed to open storage for read/write access. Storage: [\ServerBackupsTech2016-03-03T132919.vbk].
    [03.03.2016 13:29:26] Error in c++: Failed to upgrade/fix the storage [\ServerBackupsTech2016-03-03T132919.vbk].
    [03.03.2016 13:29:26] Error in c++: Client failed to process the command. Command: [prepStorageForWriteEx].
    [03.03.2016 13:29:26] Error in c++ event: ClientErrorEvt

    With the GUI, the credentials is stored & associated with the relevant share, though does not even help after a successful manual backup.

    Is there a way to specify the credentials of the share within the script ?

  18. So i got this working via GMAIL and wanted to share, but also I’m confused on my issue. So at the very end I added these parameters below. So now my script sends the email to and from and subject are all there…..BUT the body with the results is totally blank. any thoughts??????????

    $Message = New-Object System.Net.Mail.MailMessage $EmailFrom, $EmailTo
    $Message.Subject = $EmailSubject
    $Message.IsBodyHTML = $True
    $message.Body = $MesssagyBody | ConvertTo-Html -head $style | Out-String
    $SMTPClient = New-Object Net.Mail.smtpclient($smtpserver, 587)
    $SMTPClient.EnableSsl = $True
    $SMTPClient.Credentials = New-Object System.Net.NetworkCredential(“email@mydomain.com”,”password”);
    $SMTPClient.Send($EmailFrom,$EmailTo,$EmailSubject,$MessagyBody)

  19. I’m trying to use this script to run a scheduled backup to a NAS but I am getting an access denied error message, backing up to C: works with no problem, the logged in user can browse the mapped drive or the UNC path which is located on the NAS, either way specified in the script does not work and returns the following error; “The system cannot find the path specified. Failed to create or open file Z:[backup-filename].vbk”

    I tried setting the service to run as the logged in user that has access to the share but no joy, any ideas?

  20. -disableQuesqing $ string does not work, it gives an error. + when start the script without it kicks off, but it stops…and why? nobody knows…

    PS C:UsersAdministrator> C:WindowsSystem32WindowsPowerShellv1.0powershell.exe “c:scriptveeam.ps1 -VM ‘W10-Leon-
    Normal’ -Destination ‘z:w10leon’ -AutoDelete ‘Never’ -Compression 5”
    Welcome to the Veeam Backup and Replication PowerShell Toolkit!

    To list available commands, type Get-VBRCommand
    To open online documentation on all available commands, type Get-VBRToolkitDocumentation

    Copyright © Veeam Software AG. All rights reserved.

    Job Name State Start Time End Time Result
    ——– —– ———- ——– ——
    W10-Leon-Normal_2… Stopped 31-8-2016 13:20:54 31-8-2016 13:21:09 Failed

  21. Dear Geeks,

    Greetings,

    I have tried the above script to schedule VM backup from my
    ESXI host its working perfectly.

    But what I need to do right now is any possible options is
    there to take the back of VM snapshot automatically using Veeam free edition of
    backup and replication?

    If it is not possible can you, please let me know

    Is there any other script is there to take the snapshot of VM
    hosted in ESXI automatically and storing inside the ESXI data store or any
    external storage device?

    Thanks in Advance
    Regards
    Devaraj

Leave a Reply

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