Problem running "Veeam.Backup.Validator.exe" in PowerShell

PowerShell script exchange

Problem running "Veeam.Backup.Validator.exe" in PowerShell

Veeam Logoby christopher-swe » Fri Feb 10, 2017 11:10 am

I have a little problem running Veeam.Backup.Validator in PowerShell.
If I run it in a regular cmd-window it works fine, but when i run it in PowerShell i get the error "Validation Failed"

Anyone who can spot any problem with this?
Iv'e tried different way to run Veeam.Backup.Validator.exe from PowerShell.

This is the script I'm running

Code: Select all
Add-PSSnapIn VeeamPSSNapin
$Jobs = Get-VBRJob |where {$_.Name -match "Test"}
$OutputFile = "c:\temp\VeeamValidation.html"
Set-Location "C:\Program Files\Veeam\Backup and Replication\Backup\"

foreach ($Job in $Jobs) {
   
    $JobName = $Job.Name

    if ($Job.IsRunning -eq $true) {
        Write-Host $JobName "is running"
        Continue
    }

    .\Veeam.Backup.Validator.exe /backup:"$JobName" /format:html /report:"$OutputFile"
}


This is the output i get when i run it from PowerShell

Code: Select all
Veeam Backup Validator Version 9.5.0.0
Copyright (C) Veeam Software AG. All rights reserved.

File c:\temp\VeeamValidation.html will be overwritten

Parameters:
    Backup ID:          {88BD0031-1CC0-4843-BD83-05A5AB07F09B}
    Backup name:        test-job2
    Format:             Html
    Restore point date: den 10 februari 2017
    Restore point ID:   {DC01ED40-A467-45DA-8D2F-7E8D16701352}
    Restore point time: 08:19:42
    Report:             c:\temp\VeeamValidation.html
    Silence:            no
    Skip:               no

Validating...

Validating VM...
    VM name:       wps2730845
    Creation time: 2017-02-10 08:20:06
    Backup type:   full
    Platform:      VMware
    OS name:       Microsoft Windows Server 2012 (64-bit)

Reading VM summary...
    Storage path: C:\temp\backup\test-job2\test-job2D2017-02-10T081942.vbk

    wps2730845.vmx (3,5 KB)
    wps2730845.vmxf (265,0 B)
    wps2730845.nvram (8,5 KB)
    wps2730845.vmdk (604,0 B)
    wps2730845-flat.vmdk (50,0 GB)
    FsAwareMeta:92d64e45-913d-49be-a9d8-9596a4264ac2:2000 (0,0 B)

Skipping VM 'wps2730845': VM is unavailable.

Statistic:
    VM count:            1
    Incomplete VM count: 0
    Failed VM count:     1
    Files count:         1
    Total size:          3,5 KB

.\Veeam.Backup.Validator.exe : Validation failed.
At line:18 char:5
+     .\Veeam.Backup.Validator.exe /backup:"$JobName" /format:html /rep ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Validation failed.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 

The following VMs are corrupted:
 1. 'wps2730845': VM is unavailable.



And this is the output from when I run it in CMD

Code: Select all
C:\Program Files\Veeam\Backup and Replication\Backup>Veeam.Backup.Validator.exe /backup:"test-job2"
Veeam Backup Validator Version 9.5.0.0
Copyright (C) Veeam Software AG. All rights reserved.

Parameters:
    Backup ID:          {88BD0031-1CC0-4843-BD83-05A5AB07F09B}
    Backup name:        test-job2
    Format:             Html
    Restore point date: den 10 februari 2017
    Restore point ID:   {DC01ED40-A467-45DA-8D2F-7E8D16701352}
    Restore point time: 08:19:42
    Report:
    Silence:            no
    Skip:               no

Validating...

Validating VM...
    VM name:       wps2730845
    Creation time: 2017-02-10 08:20:06
    Backup type:   full
    Platform:      VMware
    OS name:       Microsoft Windows Server 2012 (64-bit)

Reading VM summary...
    Storage path: C:\temp\backup\test-job2\test-job2D2017-02-10T081942.vbk

    wps2730845.vmx (3,5 KB)
    wps2730845.vmxf (265,0 B)
    wps2730845.nvram (8,5 KB)
    wps2730845.vmdk (604,0 B)
    wps2730845-flat.vmdk (50,0 GB)
    FsAwareMeta:92d64e45-913d-49be-a9d8-9596a4264ac2:2000 (0,0 B)

    Validating wps2730845.vmx
    ████████████████████████████████████████████████████████████████████████

    Validating wps2730845.vmxf
    ████████████████████████████████████████████████████████████████████████

    Validating wps2730845.nvram
    ████████████████████████████████████████████████████████████████████████

    Validating wps2730845.vmdk
    ████████████████████████████████████████████████████████████████████████

    Validating wps2730845-flat.vmdk
    ████████████████████████████████████████████████████████████████████████

    Validating FsAwareMeta:92d64e45-913d-49be-a9d8-9596a4264ac2:2000
    ████████████████████████████████████████████████████████████████████████

Statistic:
    VM count:            1
    Incomplete VM count: 0
    Failed VM count:     0
    Files count:         6
    Total size:          50,0 GB

Validation completed successfully.

christopher-swe
Novice
 
Posts: 5
Liked: 1 time
Joined: Wed Dec 14, 2016 6:54 am
Full Name: Christopher Svensson

Re: Problem running "Veeam.Backup.Validator.exe" in PowerShe

Veeam Logoby tdewin » Fri Feb 10, 2017 3:54 pm 1 person likes this post

Are you running this from the powershell_ise? Had simular issue when running it from the ISE but not from the powershell commandline. I'm guessing it has to do with how the ISE renders the output
tdewin
Veeam Software
 
Posts: 1091
Liked: 379 times
Joined: Fri Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin

Re: Problem running "Veeam.Backup.Validator.exe" in PowerShe

Veeam Logoby christopher-swe » Fri Feb 10, 2017 6:18 pm 1 person likes this post

tdewin wrote:Are you running this from the powershell_ise? Had simular issue when running it from the ISE but not from the powershell commandline. I'm guessing it has to do with how the ISE renders the output


Oh my, you're right! :shock:

Thanks, works like a charm now! :D
christopher-swe
Novice
 
Posts: 5
Liked: 1 time
Joined: Wed Dec 14, 2016 6:54 am
Full Name: Christopher Svensson


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests