I need to retrieve the list of backups on a system's backup volume via script. The information I am after can be found in the WSB GUI after clicking "View details" of the "Destination usage" part in the "Scheduled Backup" section:
I know about the Get-WBBackupSet cmdlet, but this is only the list of backups WB knows it has done in the past, not necessarily what is present on the backup destination, which seems to be re-read dynamically each time I click "Refresh information":
How is Windows Server Backup gathering the destination information?
Rationale: I would like to set up monitoring for the backup runs performed by WB to make sure a sufficiently deep backup history is present. The list of backup sets returned by Get-WBBackupSet
seems not always consistent with what's on disk, so I rather would not rely on this information for the monitoring check.
I do not have WS2008R2 machine right away, but this is what I get on WS2012R2,
if issuing the command:
wbadmin get versions
UPD: If you run the command like:
wbadmin get items -version:10/03/2015-16:01
You will get the following:
Is that what you are looking for?
With the command "wssadmin list shadows" you get the list of shadow copies. Now we can put the list in the PowerShell variable "$copy online"
So we have to only filter the results and count items.
The number is the copies available.