Quantcast
Channel: R&D Forums
Viewing all articles
Browse latest Browse all 10150

Veeam Backup & Replication • Re: Feature Request: Disable warnings on no-object jobs

$
0
0
I think I've come up with a powershell script that would check VMware jobs to see if there is a VM target, and if not then disable and record the job. After running the next time it would check the recorded list of jobs that were previously disabled and re-enable them if a new VM has been assigned to it. I would like for it to adjust the job's description though, and am having trouble with the Set-VBRJobOptions. Any tips would be appreciated.

Here's the script that I have so far.

Code:

#Filepath to record jobs with no VMs$FilePath = "C:\Powershell Scripts\NoVMJobs.txt"#Checks Filepath to see if jobs need to be re-enabled$NoVMJobs = Get-Content -Path $FilePathForeach ($job in $NoVMJobs){    if($Jobsize -gt 1){        enable-vbrjob -job $job        ######This is where I would change the description######    }}#Deletes file so script can check jobs again and record them. Remove-Item -path $FilePath#Checks SPECIFICALLY VMware/Hyper-V jobs to see if there are any objects assigned to them.  If not it gets disabled and recorded in FilePath variable$jobs = Get-VBRJob | Where-Object {$_.JobType -ne 'EpAgentBackup' -and $_.JobType -ne 'EpAgentPolicy'}Foreach ($job in $jobs){    $Jobsize = [math]::round($job.Info.IncludedSize)    if($Jobsize -lt 1){        $job.name        disable-vbrjob -job $job        add-Content -path $FilePath $job.name        ######This is where I would change the description######    }}
I originally tried changing the description with this, but the value is read-only

Code:

$job.info.description = "This Job has been disabled because there are no Virtual Machines assigned to it"

I then tried this options based off of https://helpcenter.veeam.com/docs/backu ... ml?ver=120, but I couldn't find an option for the job description.

Code:

$description = New-VBRJobOptions -ForBackupJob$description.BackupStorageOptions.description = "test"Set-VBRJobOptions -Job $job -Options $description
Any tips would be appreciated!

Statistics: Posted by jfintervision — May 08, 2024 5:43 pm



Viewing all articles
Browse latest Browse all 10150

Latest Images

Trending Articles



Latest Images