Author | Jess Pomfret (@jpomfret), jesspomfret.com |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Enable-DbaReplPublishing on GitHub.
Want to see the Bill Of Health for this command? Check out Enable-DbaReplPublishing.
Configures a SQL Server instance as a replication publisher on an existing distributor.
Configures a SQL Server instance to publish data for replication by creating the necessary publisher configuration on an existing distributor. This is typically the second step in setting up SQL Server replication, after the distributor has been configured with Enable-DbaReplDistributor. The function sets up the snapshot working directory, configures publisher security authentication, and registers the instance as a publisher with the distribution database. The target instance must already be configured as a distributor before running this command.
Enable-DbaReplPublishing
[-SqlInstance] <DbaInstanceParameter[]>
[[-SqlCredential] <PSCredential>]
[[-SnapshotShare] <String>]
[[-PublisherSqlLogin] <PSCredential>]
[-EnableException]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
PS C:\> Enable-DbaReplPublishing -SqlInstance SqlBox1\Instance2
Enables replication publishing for instance SqlBox1\Instance2 using Windows Auth and the default InstallDataDirectory\ReplData as the snapshot folder
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 |
Specifies the network share path where replication snapshot files will be stored and accessed by subscribers.
Use this when you need snapshot files in a specific location for network access or storage requirements.
Defaults to InstallDataDirectory\ReplData if not specified.
Alias | |
Required | False |
Pipeline | false |
Default Value |
SQL Server login credentials to use for publisher security authentication instead of Windows Authentication.
Use this when the distributor and publisher are in different domains or when Windows Authentication is not available.
Windows Authentication is used by default and is the recommended method for security.
Alias | |
Required | False |
Pipeline | false |
Default Value |
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 |
If this switch is enabled, no actions are performed but informational messages will be displayed that explain what would happen if the command were to run.
Alias | wi |
Required | False |
Pipeline | false |
Default Value |
If this switch is enabled, you will be prompted for confirmation before executing any operations that change state.
Alias | cf |
Required | False |
Pipeline | false |
Default Value |