Author | Jess Pomfret (@jpomfret), jesspomfret.com |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Get-DbaReplSubscription on GitHub.
Want to see the Bill Of Health for this command? Check out Get-DbaReplSubscription.
Displays all subscriptions for a publication.
Displays all subscriptions for a publication
Get-DbaReplSubscription
[-SqlInstance] <DbaInstanceParameter[]>
[[-SqlCredential] <PSCredential>]
[[-Database] <Object[]>]
[[-PublicationName] <String[]>]
[[-SubscriberName] <DbaInstanceParameter[]>]
[[-SubscriptionDatabase] <Object[]>]
[[-Type] <Object[]>]
[-EnableException]
[<CommonParameters>]
PS C:\> Get-DbaReplSubscription -SqlInstance mssql1
Return all subscriptions for all publications on server mssql1.
PS C:\> Get-DbaReplSubscription -SqlInstance mssql1 -Database TestDB
Return all subscriptions for all publications on server mssql1 for only the TestDB database.
PS C:\> Get-DbaReplSubscription -SqlInstance mssql1 -PublicationName Mergey
Return all subscriptions for the publication Mergey on server mssql1.
PS C:\> Get-DbaReplSubscription -SqlInstance mssql1 -Type Push
Return all subscriptions for all transactional publications on server mssql1.
PS C:\> Get-DbaReplSubscription -SqlInstance mssql1 -SubscriberName mssql2
Return all subscriptions for all publications on server mssql1 where the subscriber is mssql2.
PS C:\> Get-DbaReplSubscription -SqlInstance mssql1 -SubscriptionDatabase TestDB
Return all subscriptions for all publications on server mssql1 where the subscription database is TestDB.
The target SQL Server instance or instances.
Alias | |
Required | True |
Pipeline | true (ByValue) |
Default Value |
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 |
The database(s) to process. If unspecified, all databases will be processed.
Alias | |
Required | False |
Pipeline | false |
Default Value |
The name of the publication.
Alias | |
Required | False |
Pipeline | false |
Default Value |
The subscriber SQL Server instance name.
Alias | |
Required | False |
Pipeline | false |
Default Value |
The name of the subscription database.
Alias | |
Required | False |
Pipeline | false |
Default Value |
Limit by specific type of publication. Valid choices include: Transactional, Merge, Snapshot
Alias | PublicationType |
Required | False |
Pipeline | false |
Default Value | |
Accepted Values | Push,Pull |
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 |