Get-VBRBackupSession

Short Description

Returns jobs sessions.

Applies to

Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License

Syntax

This cmdlet provides parameter sets that allow you to:

  • Get jobs sessions by session names.

Get-VBRBackupSession [-Name <String[]>]  [<CommonParameters>]

  • Get jobs sessions by session IDs.

Get-VBRBackupSession [-Id <Guid[]>]  [<CommonParameters>]

Detailed Description

This cmdlet returns jobs sessions.

You can get the sessions for the following jobs:

  • Backup jobs
  • Replication jobs
  • Backup copy jobs
  • File backup jobs
  • File backup copy jobs

Run the Get-VSBTaskSession cmdlet to get the SureBackup jobs sessions.

Run the Get-VBRSession cmdlet to get the tape jobs sessions.

Run the Get-VBRTaskSession cmdlet to get the tasks performed during specific sessions.

Parameters

Parameter

Description

Type

Required

Position

Accept
Pipeline
Input

Name

Specify the array of backup session names, followed by the backup type (Incremental, Full, Synthetic Full). The cmdlet will return the sessions with these names and the specified backup type.

String[]

False

Named

False

Id

Specifies the array of backup session IDs. The cmdlet will return the sessions with these IDs.

Guid[]

False

Named

False

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see Microsoft Docs.

Output Object

VBRBackupSession

Examples

Get-VBRBackupSessionExample 1. Getting All Backup Sessions

This command returns the list of all backup sessions.

Get-VBRBackupSession

Get-VBRBackupSessionExample 2. Getting Backup Session by Name

This command returns all Backup Copy sessions with incremental backups.

Get-VBRBackupSession -Name "Backup Copy (Incremental)"

Get-VBRBackupSessionExample 3. Getting Latest Backup Session for Backup Job

This example shows how to return the latest backup session for the backup job.

$job = Get-VBRJob -Name "ABC Job"

Get-VBRBackupSession | Where {$_.jobId -eq $job.Id.Guid} | Sort EndTimeUTC -Descending | Select -First 1

Perform the following steps:

  1. Run the Get-VBRJob cmdlet. Specify the Name parameter value. Save the result to the $job variable.
  2. Run the Get-VBRBackupSession cmdlet. Use the Where-Object method to get all backup sessions for the backup job in the $job variable. Use the Sort-Object method to get the latest backup session.

Get-VBRBackupSessionExample 4. Getting Latest Stopped Backup Session

This command returns the latest stopped backup session.

Get-VBRBackupSession | Sort {$_.state -eq "Stopped"} -Descending | Select -First 1

Get-VBRBackupSessionExample 5. Getting Backup Sessions with Warning Status

This command returns backup sessions that ended with the Warning status.

Get-VBRBackupSession | Where {$_.result -eq "Warning"}

Related Commands

Get-VBRJob

Page updated 9/4/2024

Page content applies to build 12.3.0.310