PowerShell script exchange
Post Reply
christopher-swe
Service Provider
Posts: 21
Liked: 1 time
Joined: Dec 14, 2016 6:54 am
Full Name: Christopher Svensson
Contact:

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

Post by christopher-swe »

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.

tdewin
Veeam Software
Posts: 1818
Liked: 655 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

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

Post by tdewin » 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
christopher-swe
Service Provider
Posts: 21
Liked: 1 time
Joined: Dec 14, 2016 6:54 am
Full Name: Christopher Svensson
Contact:

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

Post by christopher-swe » 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
ftravinsky
Influencer
Posts: 19
Liked: 5 times
Joined: Feb 03, 2020 10:38 am
Full Name: Fedor Travinsky
Location: Moscow
Contact:

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

Post by ftravinsky »

I was roaming Validator threads around the forum and chosen this one for reviving.

I just faced ReFS corruption on backup storage and had to "refsutil salvage" .VBK files out of offline filesystem.
Apparently, running Veeam.Backup.Validator.exe after vs multiple files seems not to be friendly.

1. Validator.exe fails to run vs .vbk files placed on remote SMB fileshare, even mapped as local drive. Succeeds only on locally attached volumes.
2. Existing Validator GUI script is still ver0.1 and didn't work for me.

I suggest Veeam team to implement "Validate-Backup" in current PowerShell module, even if it will be invoking .exe under the hood.
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

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

Post by oleg.feoktistov »

I suggest Veeam team to implement "Validate-Backup" in current PowerShell module, even if it will be invoking .exe under the hood.
If we just wrap Validator in a Powershell cmdlet, it won't solve the problem with failed runs. Throwing middleware processing in a cmdlet seems like an overkill, when we can fix issues in the Validator cli itself if any.

As for your specific issue:

1. Validator doesn't support mapped network drives, as mentioned in the user guide:
Mapped network drives are not supported. For example, you cannot specify z: \\172.16.16.198\TestShare.
2. Have you tried specifying credentials for the target network share? The guide states that /username and /password parameters are required if you want to scan backup files on a network share:

Code: Select all

Veeam.Backup.Validator.exe /file:"\\172.16.16.198\TestShare\Empty VM encryptedD2017-09-22T172639.vbk" 
/username:admin password:password
I also ran into the issues until I specified username and password for the network share even though I had access to the share with the same creds. Confirmed on 12.1.1.56

Best regards,
Oleg
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests