Get-DbaReplSubscription View Source Jess Pomfret (@jpomfret), jesspomfret.com Windows, Linux, macOS Synopsis Retrieves SQL Server replication subscription details for publications across instances.
Description Retrieves detailed information about replication subscriptions, showing which subscriber instances are receiving data from publications. This is essential for monitoring replication topology, troubleshooting subscription issues, and auditing data distribution across your SQL Server environment. You can filter results by database, publication name, subscriber instance, subscription database, or subscription type (Push/Pull) to focus on specific replication relationships.
New-DbaReplCreationScriptOptions View Source Jess Pomfret (@jpomfret), jesspomfret.com Windows, Linux, macOS Synopsis Creates replication article creation script options for controlling which database objects are replicated
Description Creates a Microsoft.SqlServer.Replication.CreationScriptOptions object that controls which database objects and properties are included when replicating tables through SQL Server replication. This determines what gets scripted at the subscriber when articles are added to publications - things like indexes, constraints, triggers, and identity columns.
By default, includes the same options that SQL Server Management Studio uses when adding articles: primary objects, custom procedures, identity properties, timestamps, clustered indexes, primary keys, collation, unique keys, and constraint replication settings.
New-DbaReplPublication View Source Jess Pomfret (@jpomfret), jesspomfret.com Windows, Linux, macOS Synopsis Creates a SQL Server replication publication for transactional, snapshot, or merge replication
Description Creates a new replication publication on a SQL Server instance that’s already configured as a publisher. This function enables publishing on the specified database, creates necessary replication agents (Log Reader for transactional/snapshot, Snapshot Agent for all types), and establishes the publication object that defines what data will be replicated to subscribers.
New-DbaReplSubscription View Source Jess Pomfret (@jpomfret), jesspomfret.com Windows, Linux, macOS Synopsis Creates SQL Server replication subscriptions to distribute data from publisher to subscriber instances.
Description Creates push or pull subscriptions for SQL Server replication, connecting a subscriber instance to an existing publication on a publisher. This function handles the setup of transactional, snapshot, and merge replication subscriptions, automatically creating the subscription database and required schemas if they don’t exist. Use this when you need to establish data replication for disaster recovery, reporting databases, or distributing data across multiple SQL Server instances without manually configuring subscription properties through SQL Server Management Studio.
Remove-DbaReplArticle View Source Jess Pomfret (@jpomfret), jesspomfret.com Windows, Linux, macOS Synopsis Removes articles from SQL Server replication publications and their associated subscriptions.
Description Removes articles from SQL Server replication publications, automatically handling subscription cleanup when subscribers exist. This function is essential when you need to stop replicating specific tables, views, or stored procedures without dismantling the entire publication.
When articles have active subscriptions, the function first removes them from all subscribers using sp_dropsubscription before removing the article from the publication itself.
Remove-DbaReplPublication View Source Jess Pomfret (@jpomfret), jesspomfret.com Windows, Linux, macOS Synopsis Removes a publication from the database on the target SQL instances.
Description Removes a publication from the database on the target SQL instances.
https://learn.microsoft.com/en-us/sql/relational-databases/replication/publish/delete-a-publication?view=sql-server-ver16#RMOProcedure
Syntax Remove-DbaReplPublication [[-SqlInstance] <DbaInstanceParameter[]>] [[-SqlCredential] <PSCredential>] [[-Database] <String>] [[-Name] <String>] [[-InputObject] <Publication[]>] [-EnableException] [-WhatIf] [-Confirm] [<CommonParameters>] Examples Example: 1 PS C:\> Remove-DbaReplPublication -SqlInstance mssql1 -Database Northwind -Name PubFromPosh Removes a publication called PubFromPosh from the Northwind database on mssql1