commands

^

Get-DbaRepPublication

Author Colin Douglas
Availability Windows only

 

Synopsis

Displays all publications for a server or database.

Description

Quickly find all transactional, merge, and snapshot publications on a specific server or database.

All replication commands need SQL Server Management Studio installed and are therefore currently not supported. Have a look at this issue to get more information: https://github.com/sqlcollaborative/dbatools/issues/7428

Syntax

Get-DbaRepPublication
    [-SqlInstance] <DbaInstanceParameter[]>
    [[-Database] <Object[]>]
    [[-SqlCredential] <PSCredential>]
    [[-PublicationType] <Object[]>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

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

Return all publications for servers sql2008 and sqlserver2012.

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

Return all publications on server sql2008 for only the TestDB database

Example: 3
PS C:\> Get-DbaRepPublication -SqlInstance sql2008 -PublicationType Transactional

Return all publications on server sql2008 for all databases that have Transactional publications

Required Parameters

-SqlInstance

The target SQL Server instance or instances.

Alias
Required True
Pipeline true (ByValue)
Default Value

Optional Parameters

-Database

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

Alias
Required False
Pipeline false
Default Value
-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
-PublicationType

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

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

byng 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

 

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