Get-VBOJobSession

In this article

    Short Description

    Returns job sessions.

    Syntax

    This cmdlet provides parameter sets that allow you to:

    • Get job sessions for jobs of the specified type and status.

    Get-VBOJobSession [-JobType {Backup | Copy}] [-Status {Stopped | Running | Success | Failed | Warning | NotConfigured | Disconnected | Queued}] [-Last]  [<CommonParameters>]

    • Get a job session for a specific job.

    Get-VBOJobSession [-Job <IVBOJobWithId>] [-Status {Stopped | Running | Success | Failed | Warning | NotConfigured | Disconnected | Queued}] [-Last]  [<CommonParameters>]

    Detailed Description

    This cmdlet returns job sessions stored in Veeam Backup for Microsoft 365.

    Job session record contains the following information:

    • Id — specifies the system ID of the job session.
    • JobId — specifies the system ID of the job.
    • JobName — specifies the job name.
    • CreationTime — specifies date and time when the job session was created.
    • EndTime — specifies date and time when the job session ended.

    Parameters

    Parameter

    Description

    Type

    Required

    Position

    Accept Pipeline Input

    Accept Wildcard Characters

    JobType

    Specifies a job type. The cmdlet will return job sessions for the jobs of the specified type:

    • Backup
    • Copy

    VBOJobSessionType

    False

    Named

    False

    False

    Job

    Specifies a job. The cmdlet will return job sessions for this job.

    IVBOJobWithId

    Accepts the VBOJob or VBOCopyJob object.

    To get this object, run the Get-VBOJob or Get-VBOCopyJob cmdlet.

    False

    Named

    True (ByValue)

    False

    Status

    Specifies a job status. The cmdlet will return job sessions for the jobs with the specified status:

    • Disconnected
    • Failed
    • NotConfigured
    • Queued
    • Running
    • Stopped
    • Success
    • Warning

    VBOJobStatus

    False

    Named

    False

    False

    Last

    Defines that the cmdlet will return the latest job session.

    If the Job parameter is used, the cmdlet will return the latest job session for the specified job.

    If the Status parameter is used, the cmdlet will return the latest job session for the jobs with the specified status.

    SwitchParameter

    False

    Named

    False

    False

    <CommonParameters>

    This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About CommonParameters section of Microsoft Docs.

    Examples

    Get-VBOJobSessionExample 1. Getting All Job Sessions

    This command returns a list of all job sessions:

    Get-VBOJobSession

    Get-VBOJobSessionExample 2. Getting Job Sessions for Backup Jobs with Success Status

    This command returns all job sessions for backup jobs with the Success status:

    Get-VBOJobSession -JobType Backup -Status Success

    Get-VBOJobSessionExample 3. Getting Latest Job Session

    This command returns the latest job session stored in Veeam Backup for Microsoft 365:

    Get-VBOJobSession -Last

    Get-VBOJobSessionExample 4. Getting Latest Job Session for Backup Jobs with Failed Status

    This command returns the latest job session for the backup jobs with the Failed status:

    Get-VBOJobSession -JobType Backup -Status Failed -Last

    Get-VBOJobSessionExample 5. Getting Statistics for Latest Job Session

    This example shows how to get statistics for the latest job session.

    $session = Get-VBOJobSession -Last

    $session.statistics

    Perform the following steps:

    1. Run the Get-VBOJobSession cmdlet with the Last parameter to get the latest job session. Save the result to the $session variable.
    2. Get the job session statistics using the Statistics property of the job session object saved to the $session variable.