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
|
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 |
True |
0 |
True (ByValue) |
|
|
Force |
Defines that cmdlet will show no prompt before executing the command. |
|
False |
Named |
False |
|
Confirm |
Defines whether the cmdlet displays a prompt that asks if the user is sure that they want to continue. |
|
False |
Named |
False |
|
WhatIf |
Defines whether the cmdlet writes a message that describes the effects of running the cmdlet without actually performing any action. |
|
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:
- Run the
Get-VESQLRestoreSessionReturns active restore sessions started to perform operations with backed-up Microsoft SQL Server databases. cmdlet. Save the result to the$sessionvariable.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.
- Run the
Get-VESQLPublishedDatabaseReturns published Microsoft SQL Server databases. cmdlet. Set the$sessionvariable as theSessionparameter value and select the necessary restore session. Specify theNameparameter value. Save the result to the$databasevariable. - Run the
Unpublish-VESQLDatabasecmdlet. Set the$databasevariable as theDatabasesparameter value.
Related Commands
Get-VESQLRestoreSessionReturns active restore sessions started to perform operations with backed-up Microsoft SQL Server databases.Get-VESQLPublishedDatabaseReturns published Microsoft SQL Server databases.