PowerShell script exchange
s.strub

Re: Generate Veeam Session Report (HTML) from Powershell

Post by s.strub »

Hello Shestakov,
Thanks for the fast response, we use Backup & Replication 9.0.
We need to know if the (a specific) Backup to Tape Job successful was. And we need pretty much all the information on this picture:
Image
The different jobs which get backup, how long they had and how big they were and how much got transferred.

Regards
Seraphim
Shestakov
Veteran
Posts: 7328
Liked: 781 times
Joined: May 21, 2014 11:03 am
Full Name: Nikita Shestakov
Location: Prague
Contact:

Re: Generate Veeam Session Report (HTML) from Powershell

Post by Shestakov »

If you have Veeam ONE, I would choose Backup Job Historical Information report. Otherwise, try scripts provided above in the thread.
Thanks!
s.strub

Re: Generate Veeam Session Report (HTML) from Powershell

Post by s.strub »

I tried this: https://github.com/tdewin/powershell/tr ... imicReport but I can't use it with Backup to Tape Jobs, normal Backup Jobs work but I need it for Tape Jobs.
Regards
Seraphim
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Generate Veeam Session Report (HTML) from Powershell

Post by veremin »

There is a Get-VBRSession cmdlets returning tape sessions. You can play with it and objects it returns and see how far you can get it with your task. Thanks.
gveat
Influencer
Posts: 23
Liked: 3 times
Joined: Sep 29, 2016 6:21 pm
Full Name: Greg Veater
Contact:

Re: Generate Veeam Session Report (HTML) from Powershell

Post by gveat »

We just did an upgrade to 2016 and VBR 9.5U1. When I run the script now, I get;

Code: Select all

PS C:\Users\gregv> C:\PS\MimicReport - Copy.ps1
Get-VBRJob : Access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\Veeam\Veeam Backup and Replication' is denied.
At C:\PS\MimicReport - Copy.ps1:657 char:17
+       $Jobs = @(Get-VBRJob | ? { $_.JobType -ieq $jobtype }) | Sort-O ...
+                 ~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], UnauthorizedAccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException
 
C:\PS\MimicReport - Copy.ps1 : Can not find Jobs with type Backup
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,MimicReport - Copy.ps1
 
C:\PS\MimicReport - Copy.ps1 : Did not write anything
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,MimicReport - Copy.ps1
gveat
Influencer
Posts: 23
Liked: 3 times
Joined: Sep 29, 2016 6:21 pm
Full Name: Greg Veater
Contact:

Re: Generate Veeam Session Report (HTML) from Powershell

Post by gveat »

Access issue was fixed by running as administrator.
gveat
Influencer
Posts: 23
Liked: 3 times
Joined: Sep 29, 2016 6:21 pm
Full Name: Greg Veater
Contact:

Re: Generate Veeam Session Report (HTML) from Powershell

Post by gveat »

I am running this script against a "Backup Copy" job. The report is retuned with no information inside of it. It is just blank with the server and Veeam version info. Is there something that needs to be changed to report on a backup copy job?
gveat
Influencer
Posts: 23
Liked: 3 times
Joined: Sep 29, 2016 6:21 pm
Full Name: Greg Veater
Contact:

Re: Generate Veeam Session Report (HTML) from Powershell

Post by gveat »

You can scratch my past couple of posts. It was an issue with a name change. I changed the name of the job and the report was running blank, until I had a session of the job complete.
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Generate Veeam Session Report (HTML) from Powershell

Post by veremin »

I was about to suggest the same: check whether the script is executed under admin account and see whether job with the provided name exists. Glad to hear, though, that you've figured it out all by yourself. :)
jnap
Enthusiast
Posts: 56
Liked: 4 times
Joined: Feb 11, 2020 4:54 pm
Contact:

Re: [MERGED] automatic tape session report or powershell

Post by jnap »

s.strub wrote: Dec 06, 2016 12:49 pm Hello,

The Veeam Support asked if I could open a Feature Request for the Problem I have, so here it is:
The Subject says it already, I'm searching a function (e.g.: a powershell command) to create a Tape Session Report in Veeam, like clicking this Button:
Image
The Button creates a HTML document with all reports, which is not necessary but nice to have.
If you need any further information please let me know.

Regards

Seraphim
Hello,

Like Seraphim, i would know if it possible to have the html report created when we click the backup job button "report" but automatically, and not for tapes but for Oracle redo logs jobs or SQL logs job...
the powershell command Get-VBRJob -Name "JOBNAME Oracle Redo Log Backup" return nothing ..
As we can't snmp-monitor this secondary jobs, i would know if it would be possible to get an html file with script instead of the email ...

Thanks!
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 669 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Generate Veeam Session Report (HTML) from Powershell

Post by oleg.feoktistov »

Hi @jnap,

Get-VBRJob doesn't retrieve such jobs by design, but you can still retrieve them using .NET methods:

Code: Select all

$sqlType = [Veeam.Backup.Model.EDbJobType]::SqlLogBackup
$oracleType = [Veeam.Backup.Model.EDbJobType]::OracleLogBackup
$sqlJob = [Veeam.Backup.Core.CBackupJob]::GetByType($sqlType)
$oracleJob = [Veeam.Backup.Core.CBackupJob]::GetByType($oracleType) 
Thanks,
Oleg
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests