forked from dsccommunity/SqlServerDsc
-
Notifications
You must be signed in to change notification settings - Fork 2
SqlServerReplication
johlju edited this page Jun 9, 2020
·
1 revision
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
InstanceName | Key | String | SQL Server instance name where replication distribution will be configured | |
Ensure | Write | String | Present, Absent | |
DistributorMode | Required | String | Local, Remote | |
AdminLinkCredentials | Required | PSCredential | Distributor administration link password | |
DistributionDBName | Write | String | Distribution database name | |
RemoteDistributor | Write | String | Distributor server name if configuring publisher with remote distributor | |
WorkingDirectory | Required | String | Publisher working directory | |
UseTrustedConnection | Write | Boolean | Publisher security mode | |
UninstallWithForce | Write | Boolean | Force flag for uninstall procedure |
The SqlReplication
DSC resource manage SQL Replication distribution
and publishing.
- Target machine must be running Windows Server 2012 or later.
- Target machine must be running SQL Server 2012 or later.
All issues are not listed here, see here for all open issues.
This example shows how to configure a SQL Server instance as the distributor.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
$SqlAdministratorCredential
)
Import-DscResource -ModuleName 'SqlServerDsc'
node localhost
{
SqlServerReplication 'distributor'
{
Ensure = 'Present'
InstanceName = 'DISTRIBUTOR' # Or 'MSSQLSERVER' for default instance.
AdminLinkCredentials = $SqlAdministratorCredential
DistributorMode = 'Local'
DistributionDBName = 'MyDistribution'
WorkingDirectory = 'C:\Temp'
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
This example shows how to configure a SQL Server instance as the publisher.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
$SqlAdministratorCredential
)
Import-DscResource -ModuleName 'SqlServerDsc'
node localhost
{
SqlServerReplication 'publisher'
{
Ensure = 'Present'
InstanceName = 'PUBLISHER' # Or 'MSSQLSERVER' for default instance.
AdminLinkCredentials = $SqlAdministratorCredential
DistributorMode = 'Remote'
DistributionDBName = 'MyDistribution'
RemoteDistributor = 'distsqlsrv.company.local\DISTRIBUTOR'
WorkingDirectory = 'C:\Temp'
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
- SqlAG
- SqlAGDatabase
- SqlAgentAlert
- SqlAgentFailsafe
- SqlAgentOperator
- SqlAGListener
- SqlAGReplica
- SqlAlias
- SqlAlwaysOnService
- SqlConfiguration
- SqlDatabase
- SqlDatabaseDefaultLocation
- SqlDatabaseMail
- SqlDatabaseObjectPermission
- SqlDatabaseOwner
- SqlDatabasePermission
- SqlDatabaseRecoveryModel
- SqlDatabaseRole
- SqlDatabaseUser
- SqlEndpoint
- SqlEndpointPermission
- SqlLogin
- SqlMaxDop
- SqlMemory
- SqlPermission
- SqlProtocol
- SqlProtocolTcpIp
- SqlReplication
- SqlRole
- SqlRS
- SqlRSSetup
- SqlScript
- SqlScriptQuery
- SqlSecureConnection
- SqlServerConfiguration
- SqlServerDatabaseMail
- SqlServerEndpoint
- SqlServerEndpointPermission
- SqlServerEndpointState
- SqlServerLogin
- SqlServerMaxDop
- SqlServerMemory
- SqlServerNetwork
- SqlServerPermission
- SqlServerProtocol
- SqlServerProtocolTcpIp
- SqlServerReplication
- SqlServerRole
- SqlServerSecureConnection
- SqlServiceAccount
- SqlSetup
- SqlWaitForAG
- SqlWindowsFirewall