< Back

Get-DbaRepPublication

Mon Jan 13, 2020 11:34 am

NAME Get-DbaRepPublication



SYNOPSIS

Displays all publications for a server or database.





SYNTAX

Get-DbaRepPublication [-SqlInstance] <Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]> [[-Database]

<System.Object[]>] [[-SqlCredential] <Pscredential>] [[-PublicationType] <System.Object[]>] [-EnableException

<Switch>] [<CommonParameters>]





DESCRIPTION

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





PARAMETERS

-Database [<System.Object[]>]

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



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-EnableException [<Switch>]

byng this switch turns this "nice by default" feature off and enables you to catch exceptions with your own

try/catch.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-PublicationType [<System.Object[]>]

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



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-SqlCredential [<Pscredential>]

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.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-SqlInstance [<Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]>]

The target SQL Server instance or instances.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Tags: Replication

Author: Colin Douglas



Website: https://dbatools.io

Copyright: (c) 2018 by dbatools, licensed under MIT

License: MIT https://opensource.org/licenses/MIT



-------------------------- 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



RELATED LINKS

https://dbatools.io/Get-DbaRepPublication