Get-VESQLPublishedDatabase

In this article

    Short Description

    Returns published Microsoft SQL databases.

    Applies to Veeam Backup & Replication

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

    Syntax

    Get-VESQLPublishedDatabase [-Session] <VESQLRestoreSession> [[-Name] <string[]>] [-ServerName <string[]>][-InstanceName <string[]>]  [<CommonParameters>]

    Detailed Description

    This cmdlet returns an array of published Microsoft SQL databases.

    Get-VESQLPublishedDatabase Note:

    The cmdlet returns published Microsoft SQL databases initiated in the PowerShell console only. The cmdlet does not return published Microsoft SQL databases published in the Veeam Backup & Replication console.

    Parameters

    Parameter

    Description

    Type

    Required

    Position

    Accept Pipeline Input

    Accept Wildcard Characters

    Session

    Specifies a restore session. The cmdlet will return information about a Microsoft SQL database added to the specified restore session.

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

    True

    0

    True (ByValue)

    False

    Name

    Specifies an array of names for Microsoft SQL databases. The cmdlet will return information about databases with the specified names.

    String[]

    False

    1

    False

    False

    ServerName

    Specifies an array of target server names. The cmdlet will get Microsoft SQL databases that are published to these servers.

    String[]

    False

    Named

    False

    False

    InstanceName

    Specifies an array of target instance names. The cmdlet will get Microsoft SQL databases that are published to these instances.

    String[]

    False

    Named

    False

    False

    <CommonParameters>

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

    Return Type

    The cmdlet returns the VESQLPublishedDatabase object that contains an array of published Microsoft SQL databases.

    Examples

    Getting List of all Published Microsoft SQL Databases

    This example shows how to get a list of all published Microsoft SQL databases.

    $session = Get-VESQLRestoreSession

    Get-VESQLPublishedDatabase -Session $session[0]

    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 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-VESQLPublishedDatabase cmdlet. Set the $session variable as the Session parameter value.

    Related Commands

    Get-VESQLRestoreSession