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

Unpublish-VESQLDatabase

Short Description

Unpublishes Microsoft SQL databases from the target SQL server.

Applies to

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 databases from the target SQL server.

Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

Accept Wildcard Characters

Database

Specifies the Microsoft SQL database. The cmdlet will unpublish this database from the target SQL server.

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

True

0

True (ByValue)

False

Force

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

SwitchParameter

False

Named

False

False

WhatIf

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

SwitchParameter

Named

False

False

False

Confirm

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

SwitchParameter

Named

False

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.

Examples

Example 1. Unpublishing Microsoft SQL Database

This example shows how to unpublish a Microsoft SQL database.

$session = Get-VESQLRestoreSession

$database = Get-VESQLPublishedDatabase -Session $session[0] -Name "SQLDatabase"

Unpublish-VESQLDatabase -Database $database

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. Specify the Name parameter value. Save the result to the $database variable.
  2. Run the Unpublish-VESQLDatabase cmdlet. Set the $database variable as the Database parameter value.

Related Commands