Posts

Showing posts from June, 2023

VEEAM GUI - single Tape Job sessions.1.0

cls Write-Host "VEEAM GUI - single Tape Job sessions.1.0" -BackgroundColor DarkRed -ForegroundColor Yellow Write-Host "Wait...Wait...Wait..." # Importing necessary .NET Assembly Add-Type -AssemblyName System.Windows.Forms [System.Windows.Forms.Application]::EnableVisualStyles() # Main Form $MainForm = New-Object System.Windows.Forms.Form $MainForm.Text = 'Veeam Tape Backup Job' $MainForm.Size = New-Object System.Drawing.Size(350, 400) $MainForm.StartPosition = 'CenterScreen' $MainForm.TopMost = $true # Prepare for CSV Export $OutputPath = 'C:\Veeam-Tape-Logs' if (!(Test-Path -Path $OutputPath -PathType Container)) { $null = New-Item -ItemType Directory -Path $OutputPath } # Fetch all tape jobs upfront $TapeJobs = Get-VBRTapeJob # GUI elements # Jobs ListBox $ListBoxJobs = New-Object System.Windows.Forms.ListBox $ListBoxJobs.Location = New-Object System.Drawing.Point(10, 10) $ListBoxJobs.Size = New-...

VEEAM GUI - single Job sessions.1.0

cls Write-Host "VEEAM GUI - single Job sessions.1.0" -BackgroundColor DarkRed -ForegroundColor Yellow Write-Host "Wait...Wait...Wait..." # Importing necessary .NET Assembly Add-Type -AssemblyName System.Windows.Forms [System.Windows.Forms.Application]::EnableVisualStyles() # Main Form $MainForm = New-Object System.Windows.Forms.Form $MainForm.Text = 'Veeam Tape Job' $MainForm.Size = New-Object System.Drawing.Size(350, 400) $MainForm.StartPosition = 'CenterScreen' $MainForm.TopMost = $true # Prepare for CSV Export $OutputPath = 'C:\Veeam-Logs' if (!(Test-Path -Path $OutputPath -PathType Container)) { $null = New-Item -ItemType Directory -Path $OutputPath } # Fetch all backup sessions upfront $BackupSessions = Get-VBRBackupSession # GUI elements # Jobs ListBox $ListBoxJobs = New-Object System.Windows.Forms.ListBox $ListBoxJobs.Location = New-Object System.Drawing.Point(10, 10) $ListBoxJobs.Size = New-Object System.Drawing.Size(300, ...

VEEAM - Export Job Sessions (logs) by Keyword

cls Write-Host "VEEAM - Export Job Sessions by Keyword" -BackgroundColor DarkRed -ForegroundColor Yellow Write-Host "Wait...Wait...Wait..." Write-Host # Define the keyword that is common to all the jobs, date and path to file $Keyword = "DB" $date = (Get-Date).ToString('yyyy-MM-dd') $folderPath = "C:\Backup\" # Get the date for desired days ago $OneYearAgo = (Get-Date).AddYears(-1) # Get all jobs that contain the keyword in their name $Jobs = Get-VBRJob | Where-Object {$_.Name -like "*$Keyword*"} # Get all sessions $AllBackupSessions = Get-VBRBackupSession # The longest part of the script Write-Host "I'm going to export all jobs with keyword $Keyword" -ForegroundColor Green foreach ($Job in $Jobs) { $BackupSessions = "" $filePath = "" $JobName = $Job.name Write-Host Write-Host "JobName: $JobName" # Get all sessions for the specified job from the past ...