Powershell - Get-RecoveryPoints for all protected machines?


I see that it is possible to get a list of all recovery points for a protected machine:

Get-RecoveryPoints -protectedserver [servername] -Number all

This list shows both BASE and Incremental recovery points which is great :-)

However I am looking for a way to display this list on all protected machines at the Core, to find all the BASE images taking up space.

Does anyone know if this is possible in stead of making the list one by one on each protected machine ?


  • There is no option to do that with the PowerShell command directly, however, there is a script that helps with that task. Test it out in your environment, it will run and create a report with the list of each base image. Hope this helps.

    $mytitle='Rapid Recovery Base Images Report'
    function convert-bytes{
     $size = [long]$bytevalue
     Switch ($Size)
     {$Size -gt 1PB} {$NewSize = “$([math]::Round(($Size / 1PB),2))PB”;Break}
     {$Size -gt 1TB} {$NewSize = “$([math]::Round(($Size / 1TB),2))TB”;Break}
     {$Size -gt 1GB} {$NewSize = “$([math]::Round(($Size / 1GB),2))GB”;Break}
     {$Size -gt 1MB} {$NewSize = “$([math]::Round(($Size / 1MB),2))MB”;Break}
     {$Size -gt 1KB} {$NewSize = “$([math]::Round(($Size / 1KB),2))KB”;Break}
     Default {$NewSize = “$([math]::Round($Size,2))Bytes”;Break}
     return $newsize
    function set-title {
    param($mytitle='Rapid Recovery Base Images Report',$startdate,$enddate,$logo)
    return @"
    <table style="Width:100%">
    <tr><td colspan="3" style="text-align:right;" >$($logo)</td></tr>
    <tr><td colspan="3" style="font: 20px Arial, Helvetica, sans-serif;font-weight: 900;color:darkred" >$($mytitle)</td></tr>
    <tr><td style="font-weight: 900;text-decoration:underline;width:250px">Core</td><td style="font-weight: 900;text-decoration:underline;width:250px">Generated On</td><td></td></tr>
    <tr><td>$($env:computername)</td><td>$($enddate.tostring("ddd MM/dd/yyyy hh:mm:ss tt"))</td></tr>
    function do-restcall{
    $emessage = "`nERROR`nREST Call on -URI `"https://$($corename):$($port)/apprecovery/api/core/$uriend`" with -Method $method has failed" 
    if($method -eq "GET"){
    $wc = New-Object System.Net.WebClient
    if($credential){$wc.Credentials = $credential}else{$wc.usedefaultcredentials=$true}
    [System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }
    [xml]$returnedobject =  $wc.DownloadString("$($uri)/$($uriend)")
    }catch{Write-Host "$emessage `r" -f Red;return $null }
    [System.Net.ServicePointManager]::ServerCertificateValidationCallback = $null
    return $returnedobject
    if(!($credential)){$defaultcredstring = "-usedefaultcredential"}else{$defaultcredstring="-Credential `$credential"}
    if($contenttype){$typestring="-ContentType `"$($ContentType)`""}
    if($body){$bodystring = "-body `$body"}
    $restmethod= @"
    Invoke-RestMethod -URI "$uri/$uriend" -Method $method -Timeoutsec $timeoutsec $defaultcredstring $typestring $bodystring -ErrorAction stop
    catch{Write-Host "$emessage `r" -f RED; return $null}
    [System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }
    [xml]$returnedobject = Invoke-Command -ScriptBlock $sb
    [System.Net.ServicePointManager]::ServerCertificateValidationCallback = $null
    return $returnedobject
    function pageheader {
    $htmlhead = @"
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    background: grey;
    text-align: left;
    font: 13px Arial, Helvetica, sans-serif;
    table {
    	border-width: 2px;
    	border-spacing: 0px;
    	border-style: solid;
    	border-collapse: collapse;
    table th {
    	font: 10px Arialbold, Helvetica, sans-serif,;
    	border-width: 2px;
    	border-spacing: 0px;
    	border-style: solid;
    table td {
    	font: 12px Arial, Helvetica, sans-serif;
    	border-width: 2px;
    	border-spacing: 0px;
    	border-style: solid;
    table tr {
    background-color: White;
    .agenttable tr:nth-child(odd) {
      background-color: #dfe7f2;
      color: #000000;
    .agenttable tr:nth-child(even) {
      background-color: lightgrey;
      color: #000000;
    .rptable tr {background-color: White;}
    .rptable th {font-size:12px;font-weight: 900;}
    .baseimage {border-width: 0px;border-collapse: collapse;width:100%;margin: 0 0 0 0;font-family:Arial, Helvetica, sans-serif;font-size:10px;padding:0px}
    /* unvisited link */
    a:link {color: black;}
    /* visited link */
    a:visited {color: black;}
    /* mouse over link */
    a:hover {color: hotpink;}
    /* selected link */
    a:active {color: darkgrey;}
    input[type=button], input[type=submit], input[type=reset] {
        background-color: white;
        color: black;
        border: 2px solid grey;
        padding: 4px 8px;
        text-decoration: none;
        margin: 2px 1px;
        cursor: pointer;
        border-radius: 12px;
    input[type=button]:hover {
        background-color: grey; 
        color: white;
    .statusOK {color:green;font-weight:800;}
    .statusFail {color:red;font-weight:800;}
    return $htmlhead
    #region get-agents
    $agents = (do-restcall -uriend 'agents').agents.agent | select-object displayname,agentType,id,repositoryName
    #region get recovery points for each agent
    $rplist = @()
    foreach($agent in $agents){
    Write-Host "Getting Recovery points for agent: $($agent.displayname)"
    [array]$rps = (do-restcall -uriend "recoveryPoints/agents/$($agent.Id)/all").recoverypointsummaries.recoverypointsummary | where {$_.status -like "*Base*"} | sort-object -Property timestamp | select-object @{n="Volumes";e={"$($_.volumeimages.volumeimagesummary.volumedisplayname -join ',')"}},status,@{n='timestamp';e={((get-date($_.timestamp)).ToLocalTime()).tostring('yyyy-MM-dd HH:mm:ss')}},@{n='size';e={(convert-bytes -bytevalue $_.size)}}
    $rplist += [pscustomobject]@{agentname=$agent.displayname;type=$agent.agenttype;agentrepo=$agent.repositoryName;count=$rps.count;rpinfo=$rps}
    Write-Host "`nBuilding agregated list of agents and recovery points." -ForegroundColor Yellow
    "`rAgregated list of agents and recovery points:" 
    #$rplist | ft -AutoSize | out-string 
    #region initialization
    $enddate = Get-Date
    $startdate = $enddate.AddDays((-1)*$days)
    $path= split-path -path $reportpath -Parent
    if(!(Test-Path $path)){
    write-host "`nPath does not exist. Attempting to create..." -f Yellow
    New-Item -Path $path -ItemType directory}
    $file = split-path -path $reportpath -leaf
    $filename = [System.IO.Path]::GetFileNameWithoutExtension($file)
    $null > $reportpath 
    #region starting the html report
    $title = set-title -mytitle $mytitle -logo $logo -startdate $startdate -enddate $enddate
    $h = pageheader
    $h += "<a name=top></a><table><tr><td><h2>$($title)</h2></td></tr></table></br>"
    $h +=@"
    <table class="rptable"><tr><th>Agent</th><th>Type</th><th>Repository</th><th>Base Image Count</th></tr>
    foreach($rp in $rplist){
    $atable +=@"
    <tr><td colspan="4"> </td></tr>
    <tr><td rowspan="2" style="font-size:12px;font-weight: 900;">$($rp.agentname)</td><td>$($rp.type)</td><td>$($rp.agentrepo)</td><td>$($rp.count)</td><tr>
    <tr><td></td><td colspan="3"><table class="agenttable"}><tr><th>Volumes</th><th>Status</th><th>Timestamp</th><th>Size</th></tr>
    $(foreach($line in $rp.rpinfo){"<tr><td>$($line.volumes)</td><td>$($line.status)</td><td>$($line.timestamp)</td><td>$($line.size)</td></tr>"})
    $h +="$($atable)</table>"
    $h | out-file -filePath $reportpath -Append
    invoke-item $reportpath

  • Thanks a lot, works like a charm :-)

Reply Children
No Data