Is there a way to find out via Veeam PS, which volumes are backed up in the respective volume backup job for a server managed Windows agent backup ?
Reason I ask is, customer has to do some post thaw actions on these volumes. I could hardcode them for each specific job, but that's unflexible, and if volumes are added or changed and people forget about the script, it will end badly.
Therefore I would prefer to read the volumes dynamically out of the backp job, it would be the safest method, but found no way to do that via job options or -parameters.
Thanks for any hints or tips.
-
- Veteran
- Posts: 1045
- Liked: 209 times
- Joined: Oct 02, 2017 7:28 pm
- Full Name: Herbert Szumovski
- Contact:
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Windows Agent Backup find out volume selection
Hi Herbert,
If your customer is on v10, here is the example:
Best regards,
Oleg
If your customer is on v10, here is the example:
Code: Select all
$jobname = Read-Host -Prompt 'Enter Job Name'
$jobs = Get-VBRComputerBackupJob -Name $jobname
foreach ($job in $jobs) {
if ($job.BackupType -eq 'SelectedVolumes' -and !$job.SelectedVolumes) {
$job | Select-Object Name, @{n='Volumes';e={'Operating System'}}
}
elseif ($job.BackupType -eq 'SelectedVolumes' -and $job.SelectedVolumes) {
$volumes = @()
foreach ($volume in $job.SelectedVolumes) {
$volumes += $volume.Path
}
$job | Select-Object Name, @{n='Volumes';e={$volumes}}
}
}
Oleg
-
- Veteran
- Posts: 1045
- Liked: 209 times
- Joined: Oct 02, 2017 7:28 pm
- Full Name: Herbert Szumovski
- Contact:
Re: Windows Agent Backup find out volume selection
Works fine, thanks a lot, Oleg!
Who is online
Users browsing this forum: No registered users and 15 guests