Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issue 51 #55

Merged
merged 1 commit into from
Jul 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions DSCResources/MSFT_xSQLAOGroupEnsure/MSFT_xSQLAOGroupEnsure.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ function Set-TargetResource
[System.String]
$AutoBackupPrefernce ="Primary",

[System.UInt32]
$EndPointPort ="5022",

[System.String]
$SQLServer = $env:COMPUTERNAME,

Expand Down Expand Up @@ -156,7 +159,7 @@ function Set-TargetResource
Try
{
$Replica = New-Object -typename Microsoft.SqlServer.Management.Smo.AvailabilityReplica -ArgumentList $availabilityGroup, $node
$Replica.EndpointUrl = "TCP://$($node):5022"
$Replica.EndpointUrl = "TCP://$($node):$EndPointPort"
$Replica.FailoverMode = [Microsoft.SqlServer.Management.Smo.AvailabilityReplicaFailoverMode]::Automatic
$Replica.AvailabilityMode = [Microsoft.SqlServer.Management.Smo.AvailabilityReplicaAvailabilityMode]::SynchronousCommit
#Backup Priority Gives the ability to set a priority of one secondany over another valid values are from 1 - 100
Expand All @@ -179,7 +182,7 @@ function Set-TargetResource
Try
{
$asyncReplica = New-Object -typename Microsoft.SqlServer.Management.Smo.AvailabilityReplica -ArgumentList $availabilityGroup, $node
$asyncReplica.EndpointUrl = "TCP://$($node):5022"
$asyncReplica.EndpointUrl = "TCP://$($node):$EndPointPort"
$asyncReplica.FailoverMode = [Microsoft.SqlServer.Management.Smo.AvailabilityReplicaFailoverMode]::Manual
$asyncReplica.AvailabilityMode = [Microsoft.SqlServer.Management.Smo.AvailabilityReplicaAvailabilityMode]::ASynchronousCommit
$asyncReplica.BackupPriority = 50
Expand Down Expand Up @@ -308,6 +311,9 @@ function Test-TargetResource
[System.String]
$AutoBackupPrefernce="Primary",

[System.UInt32]
$EndPointPort ="5022",

[System.String]
$SQLServer = $env:COMPUTERNAME,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class MSFT_xSQLAOGroupEnsure : OMI_BaseResource
[Write] Uint32 AvailabilityGroupPort;
[Write, ValueMap{"None","ReadOnly","ReadIntent"}, Values{"None","ReadOnly","ReadIntent"}] String ReadableSecondary;
[Write, ValueMap{"Primary","Secondary"}, Values{"Primary","Secondary"}] String AutoBackupPrefernce;
[Write] Uint32 EndPointPort;
[Write] String SQLServer;
[Write] String SQLInstanceName;
[Required, EmbeddedInstance("MSFT_Credential"), Description("Credential to be used to Grant Permissions in SQL.")] String SetupCredential;
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ Please check out common DSC Resources [contributing guidelines](https://github.c
* **AvailabilityGroupPort** Port availability group should listen on
* **ReadableSecondary** Mode secondaries should operate under (None, ReadOnly, ReadIntent)
* **AutoBackupPreference** Where backups should be backed up from (Primary,Secondary)
* **EndPointPort** The TCP port for the SQL AG Endpoint (default 5022)
* **SQLServer**: The SQL Server for the database
* **SQLInstance**: The SQL instance for the database
* **SetupCredential**: (Required) Credential to be used to Grant Permissions on SQL Server
Expand Down