I am currently trying to create a powershell script that shows the amount of restore point per VM per Job. I tried creating some things but I am unable to complete it.
$job = "jobname"
$vm = "vmname"
$count = $(get-vbrbackup -name $job | Get-VBRRestorePoint -Name $vm | Measure-Object).Count
write-host $count
But that only shows it it for 1 vm for an explicit job. I googled alot and the closest thing I could find on what we want is the following script
Get-VBRRestorePoint | Select Name, @{N="Job Name";E={$_.FindSourceJob().name}} | Group Name,"Job Name" | Sort Name > test2.txt
Which outputs the following:
Code: Select all
Count Name Group
----- ---- -----
7 server1 {@{Name=server1; Job Name=job1}, @{Name=server1; Job Name=CO...
1 server1 {@{Name=server1; Job Name=job2}}
7 server1 {@{Name=server1; Job Name=job3}, @{Name=server1; Job Name=TAP...
14 server1 {@{Name=server1; Job Name=job4}, @{Name=server1; Job Nam...
The colums 'group' must only contain the jobname. Anyone has an idea on how to do this?