-
Notifications
You must be signed in to change notification settings - Fork 224
SqlEndpoint
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
EndpointName | Key | String | The name of the endpoint. | |
InstanceName | Key | String | The name of the SQL Server instance to be configured. | |
EndpointType | Required | String | Specifies the type of endpoint. Currently the only types that are supported are the Database Mirroring and the Service Broker type. |
DatabaseMirroring , ServiceBroker
|
Ensure | Write | String | If the endpoint should be present or absent. Default values is 'Present' . |
Present , Absent
|
Port | Write | UInt16 | The network port the endpoint is listening on. Default value is 5022 , but default value is only used during endpoint creation, it is not enforce. |
|
ServerName | Write | String | The host name of the SQL Server to be configured. Default value is the current computer name. | |
IpAddress | Write | String | The network IP address the endpoint is listening on. Default value is '0.0.0.0' which means listen on any valid IP address. The default value is only used during endpoint creation, it is not enforce. |
|
Owner | Write | String | The owner of the endpoint. Default is the login used for the creation. | |
IsMessageForwardingEnabled | Write | Boolean | Specifies whether messages received by this endpoint that are for services located elsewhere will be forwarded. | |
MessageForwardingSize | Write | UInt32 | Specifies the maximum amount of storage in megabytes to allocate for the endpoint to use when storing messages that are to be forwarded. | |
State | Write | String | Specifies the state of the endpoint. When an endpoint is created and the state is not specified then the endpoint will be started after it is created. The state will not be enforced unless the parameter is specified. |
Started , Stopped , Disabled
|
The SqlEndpoint
DSC resource is used to create an endpoint. Currently
it only supports creating a database mirror and a service broker endpoint. A database mirror
endpoint can be used by AlwaysOn.
Important
The endpoint will be started after creation, but will not be enforced
unless the the parameter State
is specified.
[!TIP] To set connect permission to the endpoint, please use the resource SqlEndpointPermission.
- Target machine must be running Windows Server 2012 or later.
- Target machine must be running SQL Server Database Engine 2012 or later.
- The built-in parameter PsDscRunAsCredential must be set to the credentials of an account with the permission to create and alter endpoints.
All issues are not listed here, see here for all open issues.
This example will add a Database Mirror endpoint, to two instances, using the default values.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
$SqlAdministratorCredential
)
Import-DscResource -ModuleName 'SqlServerDsc'
node localhost
{
SqlEndpoint 'SQLConfigureEndpoint-Instance1'
{
EndpointName = 'HADR'
EndpointType = 'DatabaseMirroring'
InstanceName = 'INST1'
PsDscRunAsCredential = $SqlAdministratorCredential
}
SqlEndpoint 'SQLConfigureEndpoint-Instances2'
{
EndpointName = 'HADR'
EndpointType = 'DatabaseMirroring'
InstanceName = 'INST2'
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
This example will add a Database Mirror endpoint with specific listener port, listener IP address and owner.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
$SqlAdministratorCredential
)
Import-DscResource -ModuleName 'SqlServerDsc'
node localhost
{
SqlEndpoint 'SQLConfigureEndpoint'
{
Ensure = 'Present'
EndpointName = 'HADR'
EndpointType = 'DatabaseMirroring'
Port = 9001
IpAddress = '192.168.0.20'
Owner = 'sa'
State = 'Started'
ServerName = 'server1.company.local'
InstanceName = 'INST1'
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
This example will add a Service Broker endpoint, to a instance, complete with MessageForwarding
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
$SqlAdministratorCredential
)
Import-DscResource -ModuleName 'SqlServerDsc'
node localhost
{
SqlEndpoint 'ServiceBroker'
{
Ensure = 'Present'
EndpointName = 'SSBR'
EndpointType = 'ServiceBroker'
Port = 5023
IpAddress = '192.168.0.20'
Owner = 'sa'
State = 'Started'
ServerName = 'server1.company.local'
InstanceName = 'INST1'
IsMessageForwardingEnabled = $true
MessageForwardingSize = 2
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
This example will remove an Database Mirror endpoint from two instances.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
$SqlAdministratorCredential
)
Import-DscResource -ModuleName 'SqlServerDsc'
node localhost
{
SqlEndpoint 'SQLConfigureEndpoint-Instance1'
{
Ensure = 'Absent'
EndpointName = 'HADR'
EndpointType = 'DatabaseMirroring'
InstanceName = 'INST1'
PsDscRunAsCredential = $SqlAdministratorCredential
}
SqlEndpoint 'SQLConfigureEndpoint-Instance2'
{
Ensure = 'Absent'
EndpointName = 'HADR'
EndpointType = 'DatabaseMirroring'
InstanceName = 'INST2'
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
- Add-SqlDscNode
- Add-SqlDscTraceFlag
- Complete-SqlDscFailoverCluster
- Complete-SqlDscImage
- Connect-SqlDscDatabaseEngine
- ConvertFrom-SqlDscDatabasePermission
- ConvertFrom-SqlDscServerPermission
- ConvertTo-SqlDscDatabasePermission
- ConvertTo-SqlDscServerPermission
- Disable-SqlDscAudit
- Disconnect-SqlDscDatabaseEngine
- Enable-SqlDscAudit
- Get-SqlDscAudit
- Get-SqlDscConfigurationOption
- Get-SqlDscDatabasePermission
- Get-SqlDscManagedComputer
- Get-SqlDscManagedComputerService
- Get-SqlDscPreferredModule
- Get-SqlDscServerPermission
- Get-SqlDscStartupParameter
- Get-SqlDscTraceFlag
- Import-SqlDscPreferredModule
- Initialize-SqlDscRebuildDatabase
- Install-SqlDscServer
- Invoke-SqlDscQuery
- New-SqlDscAudit
- Remove-SqlDscAudit
- Remove-SqlDscNode
- Remove-SqlDscTraceFlag
- Repair-SqlDscServer
- Save-SqlDscSqlServerMediaFile
- Set-SqlDscAudit
- Set-SqlDscDatabasePermission
- Set-SqlDscServerPermission
- Set-SqlDscStartupParameter
- Set-SqlDscTraceFlag
- Test-SqlDscIsDatabasePrincipal
- Test-SqlDscIsLogin
- Test-SqlDscIsSupportedFeature
- Uninstall-SqlDscServer
- SqlAG
- SqlAGDatabase
- SqlAgentAlert
- SqlAgentFailsafe
- SqlAgentOperator
- SqlAGListener
- SqlAGReplica
- SqlAlias
- SqlAlwaysOnService
- SqlAudit
- SqlConfiguration
- SqlDatabase
- SqlDatabaseDefaultLocation
- SqlDatabaseMail
- SqlDatabaseObjectPermission
- SqlDatabasePermission
- SqlDatabaseRole
- SqlDatabaseUser
- SqlEndpoint
- SqlEndpointPermission
- SqlLogin
- SqlMaxDop
- SqlMemory
- SqlPermission
- SqlProtocol
- SqlProtocolTcpIp
- SqlReplication
- SqlRole
- SqlRS
- SqlRSSetup
- SqlScript
- SqlScriptQuery
- SqlSecureConnection
- SqlServiceAccount
- SqlSetup
- SqlTraceFlag
- SqlWaitForAG
- SqlWindowsFirewall