PowerShell script exchange
Post Reply
Erwin Linker
Service Provider
Posts: 53
Liked: 4 times
Joined: Mar 30, 2016 12:58 pm
Full Name: Erwin Linker
Location: The Netherlands
Contact:

restorepoint information

Post by Erwin Linker »

Hi,

Is there a way to see the difference between a "Full" or "Full synthetic" restorepoint through powershell?

Regards,
Erwin

oleg.feoktistov
Veeam Software
Posts: 904
Liked: 319 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: restorepoint information

Post by oleg.feoktistov »

Hi Erwin,

Since "Synthentic" value from EAlgorithm enum is never used for Algorithm property of a restore point object, there is no way to determine it directly. But it is possible by correlating session algorithm with the points created during particular session run. Here is an example:

Code: Select all

$job = Get-VBRJob -Name 'Backup Job'
$backup = Get-VBRBackup -Name "$($Job.Name)"
$oibs = Get-VBRRestorePoint -Backup $backup
$sessions = Get-VBRBackupSession -Name "*$($Job.Name)*"
$taskSessions = @()
foreach ($session in $sessions) {
  $taskSession = Get-VBRTaskSession -Session $session
  $taskSessions += $taskSession
}
foreach ($oib in $oibs) {
  $filteredTask = $taskSessions | where {$_.WorkDetails.OibId -eq $oib.Id}
  $activeFull = $filteredTask.JobSess.SessionInfo.IsActiveFullMode
  $full = $filteredTask.JobSess.SessionInfo.IsFullMode
  $algorithm = ''
  if ($activeFull -eq $true) {
    $algorithm = 'ActiveFull'
  }
  elseif ($activeFull -eq $false -and $full -eq $true) {
    $algorithm = 'SyntethicFull'
  }
  elseif ($activeFull -eq $false -and $full -eq $false) {
    $algorithm = 'Increment'
  }
  else {
   throw 'Unknown session algorithm'
  }
  $oib | select Name, @{n='Algorithm';e={$algorithm}}
} 
Hope it helps,
Oleg

Erwin Linker
Service Provider
Posts: 53
Liked: 4 times
Joined: Mar 30, 2016 12:58 pm
Full Name: Erwin Linker
Location: The Netherlands
Contact:

Re: restorepoint information

Post by Erwin Linker »

Hi Oleg,

Thanks for the answer, i did some changes to the powershell and i think i have it now.

Code: Select all

$job = Get-VBRJob -Name 'PDC1_Performance'
$backup = Get-VBRBackup -Name "$($Job.Name)"
$oibs = Get-VBRRestorePoint -Backup $backup
$sessions = Get-VBRBackupSession -Name "*$($Job.Name)*"
$taskSessions = @()
foreach ($session in $sessions) {
  $taskSession = Get-VBRTaskSession -Session $session
  $taskSessions += $taskSession
}
foreach ($oib in $oibs) {
  $activeFull = $oib.Algorithm
  $full = $oib.IsFull

  $algorithm = ''
  if ($activeFull -eq "Syntethic") {
    $algorithm = 'ActiveFull'
  }
  elseif ($activeFull -eq "Full" -and $full -eq $true) {
    $algorithm = 'SyntethicFull'
  }
  elseif ($activeFull -eq "Increment" -and $full -eq $false) {
    $algorithm = 'Increment'
  }
  else {
   throw 'Unknown session algorithm'
  }
  $oib | select Name, @{n='Algorithm';e={$algorithm}}
} 
With this the "Full" back-up is marked as "ActiveFull" and the Syntethic is marked as "SyntethicFull".

Regards,
Erwin

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests