commands

^

Get-DbaReplPublication

Author Colin Douglas
Availability Windows, Linux, macOS

 

Aliases : Get-DbaRepPublication

Want to see the source code for this command? Check out Get-DbaReplPublication on GitHub.
Want to see the Bill Of Health for this command? Check out Get-DbaReplPublication.

Synopsis

Displays all publications on a server.

Description

Quickly find all transactional, merge, and snapshot publications on a server or filter by database, name or type.

Syntax

Get-DbaReplPublication
    [-SqlInstance] <DbaInstanceParameter[]>
    [[-SqlCredential] <PSCredential>]
    [[-Database] <Object[]>]
    [[-Name] <String>]
    [[-Type] <Object[]>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbaReplPublication -SqlInstance sql2008, sqlserver2012

Return all publications for servers sql2008 and sqlserver2012.

Example: 2
PS C:\> Get-DbaReplPublication -SqlInstance sql2008 -Database TestDB

Return all publications on server sql2008 for only the TestDB database

Example: 3
PS C:\> Get-DbaReplPublication -SqlInstance sql2008 -Type Transactional

Return all transactional publications on server sql2008.

Example: 4
PS C:\> Get-DbaReplPublication -SqlInstance mssql1 -Name Merge

Returns the Mergey publications on server mssql1

Example: 5
PS C:\> Connect-DbaInstance -SqlInstance mssql1 | Get-DbaReplPublication

Returns all publications on server mssql1 using the pipeline.

Required Parameters

-SqlInstance

The target SQL Server instance or instances.

Alias
Required True
Pipeline true (ByValue)
Default Value

Optional Parameters

-SqlCredential

Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential). Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported. For MFA support, please use Connect-DbaInstance.

Alias
Required False
Pipeline false
Default Value
-Database

The database(s) to process. If unspecified, all databases will be processed.

Alias
Required False
Pipeline false
Default Value
-Name

The name of the publication.

Alias
Required False
Pipeline false
Default Value
-Type

Limit by specific type of publication. Valid choices include: Transactional, Merge, Snapshot.

Alias PublicationType
Required False
Pipeline false
Default Value
Accepted Values Transactional,Merge,Snapshot
-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message. This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting. Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Alias
Required False
Pipeline false
Default Value False