Help Center
Choose product document...
Veeam Backup & Replication 9.5 Update 4
Veeam Explorers PowerShell Reference

Publish-VESQLDatabase

Short Description

Publishes Microsoft SQL databases.

Applies to

Product Edition: Community, Standard, Enterprise, Enterprise Plus

Syntax

Publish-VESQLDatabase [-Database] <VESQLDatabase> -ServerName <String> [-DatabaseName <String>] [-InstanceName <String>] [-Port <Int32>] [-UseSQLAuthentication <SwitchParameter>] [-SqlCredentials <PSCredential>] [-GuestCredentials <PSCredential>] [-ToPointInTime <DateTime>] [-Force <SwitchParameter>] [<CommonParameters>]

Detailed Description

This cmdlet allows you to publish Microsoft SQL databases.

Parameters

Parameter

Description

Required

Position

Accept
Pipeline
Input

Accept
Wildcard
Characters

Database

Specifies a Microsoft SQL database that you want to publish.

Accepts the VESQLDatabase type.

True

0

True (ByValue)

False

ServerName

Specifies a name of the target server. The cmdlet will publish a Microsoft SQL database to that server.

True

Named

False

False

DatabaseName

Specifies a name for a Microsoft SQL database. The cmdlet will publish the existing database with the new name.

False

Named

False

False

InstanceName

Specifies a name of the target instance. The cmdlet will publish a Microsoft SQL database to that instance.

False

Named

False

False

Port

Specifies a port number. the cmdlet will use this port to connect to a Microsoft SQL server.

False

Named

False

False

SqlCredentials

Specifies credentials to authenticate against a Microsoft SQL server. If you do not specify the SQL credentials, the cmdlet will use the current account credentials.

False

Named

False

False

UseSQLAuthentication

Indicates that the cmdlet will use the SQL authentication to connect to the target Microsoft SQL server.

False

Named

False

False

GuestCredentials

Specifies credentials to authenticate against the target server.

NOTE:

  • If you omit this parameter, the cmdlet will use credentials specified in the SqlCredentials parameter to connect to both the Microsoft SQL server and to the OS guest.
  • If you do not specify SQL credentials, the cmdlet will use the current account credentials.

False

Named

False

False

ToPointInTime

Specifies the point in time within a restore interval of a Microsoft SQL database.

The cmdlet will publish the database to the state of the specified point in time.

False

Named

False

False

Force

Indicates that the cmdlet will overwrite the existing database with the database from the backup.

NOTE: The cmdlet will show no prompt before executing the command.

False

Named

False

False

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information about common parameters, see http://go.microsoft.com/fwlink/p/?LinkID=113216.

Return Type

Example

This example shows how to publish a Microsoft SQL database.

  1. Run Get-VESQLRestoreSession to get a restore session for a Microsoft SQL database. Save the result to the $session variable.
  2. Run Get-VESQLDatabase with the $session variable and the Name parameter to specify the Microsoft SQL database that you want to publish.. Save the result to the $database variable.
  3. Run Publish-VESQLDatabase with the $database variable. Use the ServerName parameter to specify the target server.

PS C:\PS> $session = Get-VESQLRestoreSession

PS C:\PS> $database = Get-VESQLDatabase -Session $session[0] -Name "SQLDatabase"

PS C:\PS> Publish-VESQLDatabase -Database $database -ServerName "TargetServer"

Related Commands

Veeam Large Logo

User Guide for VMware vSphere

User Guide for Microsoft Hyper-V

Enterprise Manager User Guide

Veeam Cloud Connect Guide

Veeam Agent Management Guide

Veeam Explorers User Guide

Backup and Restore of SQL Server Databases

Veeam Plug-ins for Enterprise Applications

PowerShell Reference

Veeam Explorers PowerShell Reference

RESTful API Reference

Required Permissions

Veeam Availability for Nutanix AHV

Veeam Backup for Microsoft Office 365 Documentation

Veeam ONE Documentation

Veeam Agent for Windows Documentation

Veeam Agent for Linux Documentation

Veeam Management Pack Documentation