Unpublish-VESQLDatabase

Short Description

Unpublishes Microsoft SQL Server databases from the target server.

Applies to

Veeam Backup & Replication

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

Syntax

Unpublish-VESQLDatabase [-Databases] <VESQLPublishedDatabase[]> [-Force <SwitchParameter>] [-WhatIf <SwitchParameter>] [-Confirm <SwitchParameter>] [<CommonParameters>]

Detailed Description

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

Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

Database

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-VESQLPublishedDatabase cmdlet.

True

0

True (ByValue)

Force

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

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

Named

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

<CommonParameters>

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

Example

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 cmdlet will return an array of restore sessions. Note 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 and select the necessary restore session. 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

Page updated 4/19/2024

Page content applies to build 12.3.0.310