cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve the DiskStorageKeepForHours value for a job via BEMCLI

rduzenbury
Level 0

Hi,

I'd like to write a script to pull the DiskStorageKeepForHours attribute for all of my backup jobs that write to disk.  So far, the best I've been able to accomplish is to export the job definitions via the following code:

$jobs = Get-BEBackupDefinition
foreach ($job in $jobs)
{
$defname = $job.name
$job | Export-BEBackupDefinition > c:\src\jobdefs\$($defname).ps1
}

Then, I have to trawl the script to find the attributes I'm interested in.

I see from the documentation that I can, for example, Add-BEDifferentialBackupTask or Set-BEDifferentialBackupTask, but I don't see any way to Get-BEDifferentialTask, which is where I'd expect to find the DiskStorageKeepForHours for the differential portion of my backup.

Thank you.

Regards,

Rich

1 REPLY 1

Gurvinder
Moderator
Moderator
Employee Accredited Certified

I will research the bemcli way but what if you explore the sql way and check dataretentionhours, job name column of vwjobpropertiesbackup table in sql. does  that help ?