Unpublish-VESQLDatabase

Short Description

Unpublishes Microsoft SQL Server databases from the target server.

Product: Veeam Backup & Replication

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

Syntax

Unpublish-VESQLDatabase [-Databases] <VESQLPublishedDatabase[]> [-Force]

[-WhatIf] [-Confirm] [<CommonParameters>]

Detailed Description

This cmdlet unpublishes Microsoft SQL Server databases from the target machine with Microsoft SQL Server.

Parameters

Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

Databases

Specifies the published Microsoft SQL Server databases. The cmdlet will unpublish these databases from the target server.

Accepts the VESQLPublishedDatabase[] object. To get this object, run the Get-VESQLPublishedDatabaseReturns published Microsoft SQL Server databases. cmdlet.

VESQLPublishedDatabase[]

True

0

True (ByValue)

Force

Defines that cmdlet will show no prompt before executing the command.

SwitchParameter

False

Named

False

Confirm

Defines whether the cmdlet displays a prompt that asks if the user is sure that they want to continue.

SwitchParameter

False

Named

False

WhatIf

Defines whether the cmdlet writes a message that describes the effects of running the cmdlet without actually performing any action.

SwitchParameter

False

Named

False

<CommonParameters>

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

Examples

Unpublishing Microsoft SQL Server Database

This example shows how to unpublish a Microsoft SQL Server database.

$session = Get-VESQLRestoreSession

$database = Get-VESQLPublishedDatabase -Session $session[0] -Name "New SQL Database"

Unpublish-VESQLDatabase -Databases $database

Perform the following steps:

  1. Run the Get-VESQLRestoreSessionReturns active restore sessions started to perform operations with backed-up Microsoft SQL Server databases. cmdlet. Save the result to the $session variable.

    The cmdlet will return an array of restore sessions. Note the ordinal number of the necessary restore session. In this example, it is the first restore session in the array.

  2. Run the Get-VESQLPublishedDatabaseReturns published Microsoft SQL Server databases. cmdlet. Set the $session variable as the Session parameter value and select the necessary restore session. Specify the Name parameter value. Save the result to the $database variable.
  3. Run the Unpublish-VESQLDatabase cmdlet. Set the $database variable as the Databases parameter value.

Page updated 2026-08-20

Page content applies to build 13.1.1.18