This is an archive version of the document. To get the most up-to-date information, see the current version.

Get-VESQLDatabase

In this article

    Short Description

    Returns backed-up Microsoft SQL databases.

    Applies to Veeam Backup & Replication

    Product Edition: Community, Standard, Enterprise, Enterprise Plus

    Syntax

    Get-VESQLDatabase [-Session] <VESQLRestoreSession> [[-Name] <string[]>]  [<CommonParameters>]

    Detailed Description

    This cmdlet returns an array of backed-up Microsoft SQL databases.

    After you get backed-up Microsoft SQL databases, you can perform the following operations with these databases:

    Parameters

    Parameter

    Description

    Type

    Required

    Position

    Accept Pipeline Input

    Accept Wildcard Characters

    Session

    Specifies an active restore session. The cmdlet will return an array of Microsoft SQL databases within the specified restore session.

    Accepts the VESQLRestoreSession object. To get this object, run the Get-VESQLRestoreSession cmdlet.

    True

    0

    True (ByValue)

    False

    Name

    Specifies a name of a Microsoft SQL database. The cmdlet will return an array of Microsoft SQL databases with the specified name.

    String[]

    False

    1

    False

    Yes

    <CommonParameters>

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

    Return Type

    The cmdlet returns the VESQLDatabase[] object that contains an array of backed-up Microsoft SQL databases.

    Examples

    Example 1. Getting Microsoft SQL Databases Within Specified Restore Session

    This example shows how to get a list of Microsoft SQL databases within the specified restore session.

    $session = Get-VESQLRestoreSession

    Get-VESQLDatabase -Session $session[1]

    You must perform the following steps:

    1. Run the Get-VESQLRestoreSession cmdlet. Save the result to the $session variable.

    The Get-VESQLRestoreSession cmdlet will return an array of active restore sessions. Mind the ordinal number of the necessary restore session (in our example, it is the second restore session in the array).

    1. Run the Get-VESQLDatabase cmdlet. Set the $session variable as the Session parameter value.

    Example 2. Getting Microsoft SQL Database With Specified Name

    This example shows how to get a Microsoft SQL database with the specified name.

    $session = Get-VESQLRestoreSession

    Get-VESQLDatabase -Session $session[0] -Name "SQLDatabase"

    You must perform the following steps:

    1. Run the Get-VESQLRestoreSession cmdlet. Save the result to the $session variable.

    The Get-VESQLRestoreSession cmdlet will return an array of active restore sessions. Mind the ordinal number of the necessary restore session (in our example, it is the first restore session in the array).

    1. Run the Get-VESQLDatabase cmdlet. Set the $session variable as the Session parameter value. Specify the Name parameter value.

    Related Commands

    Get-VESQLRestoreSession