Get-DbaReplPublisher View Source Mikey Bronowski (@MikeyBronowski), bronowski.it Windows, Linux, macOS Synopsis Retrieves SQL Server replication publisher configuration and status from distribution servers.
Description Retrieves detailed information about SQL Server replication publishers configured on distribution servers. This function connects to instances acting as distributors and returns publisher details including status, working directory, distribution database, and publication counts. Use this to audit replication topology, troubleshoot publisher connectivity issues, or verify publisher configurations across your replication environment.
Get-DbaReplServer View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Retrieves replication configuration and server role information from SQL Server instances
Description Returns a ReplicationServer object that shows whether each SQL Server instance is configured as a distributor, publisher, or both in the replication topology. This helps DBAs quickly identify server roles and distribution database configurations when troubleshooting replication issues or documenting replication environments. The function reveals which databases are enabled for replication, though these may not necessarily be actively replicated.
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
Test-DbaReplLatency View Source Colin Douglas Windows, Linux, macOS Synopsis Measures transactional replication latency using tracer tokens across publisher, distributor, and subscriber instances.
Description Creates tracer tokens in transactional replication publications and measures the time it takes for those tokens to travel from the publisher to the distributor, and from the distributor to each subscriber. This provides real-time latency measurements that help DBAs identify replication performance bottlenecks and validate that data changes are flowing through the replication topology within acceptable timeframes.