Skip to content

Commit

Permalink
Changes to SqlServerDsc
Browse files Browse the repository at this point in the history
- Style changes in all examples, removing type [System.Management.Automation.Credential()]
  from credential parameters (issue dsccommunity#1003), and renamed the credential parameter so it is
  not using abbreviation.
  • Loading branch information
johlju committed Jan 7, 2018
1 parent e7b08c1 commit c91e6d6
Show file tree
Hide file tree
Showing 65 changed files with 171 additions and 234 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
- Resources that did not have a description in the README.md now has one.
- Resources that missed links to the examples in the README.md now has those
links.
- Style changes in all examples, removing type [System.Management.Automation.Credential()]
from credential parameters ([issue #1003](https://github.com/PowerShell/SqlServerDsc/issues/1003)),
and renamed the credential parameter so it is not using abbreviation.
- Changes to SqlAlias
- Fixed issue where exception was thrown if reg keys did not exist
([issue #949](https://github.com/PowerShell/SqlServerDsc/issues/949)).
Expand Down
10 changes: 5 additions & 5 deletions Examples/Resources/SqlAG/1-CreateAvailabilityGroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Configuration Example
param(
[Parameter(Mandatory = $true)]
[PSCredential]
$SysAdminAccount
$SqlAdministratorCredential
)

Import-DscResource -ModuleName SqlServerDsc
Expand All @@ -47,7 +47,7 @@ Configuration Example
LoginType = 'WindowsUser'
ServerName = $Node.NodeName
InstanceName = $Node.InstanceName
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}

# Add the required permissions to the cluster service login
Expand All @@ -59,7 +59,7 @@ Configuration Example
InstanceName = $Node.InstanceName
Principal = 'NT SERVICE\ClusSvc'
Permission = 'AlterAnyAvailabilityGroup', 'ViewServerState'
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}

# Create a DatabaseMirroring endpoint
Expand All @@ -70,7 +70,7 @@ Configuration Example
Port = 5022
ServerName = $Node.NodeName
InstanceName = $Node.InstanceName
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}

if ( $Node.Role -eq 'PrimaryReplica' )
Expand All @@ -83,7 +83,7 @@ Configuration Example
InstanceName = $Node.InstanceName
ServerName = $Node.NodeName
DependsOn = '[SqlServerEndpoint]HADREndpoint', '[SqlServerPermission]AddNTServiceClusSvcPermissions'
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Examples/Resources/SqlAG/2-RemoveAvailabilityGroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Configuration Example
param(
[Parameter(Mandatory = $true)]
[PSCredential]
$SysAdminAccount
$SqlAdministratorCredential
)

Import-DscResource -ModuleName SqlServerDsc
Expand All @@ -48,7 +48,7 @@ Configuration Example
Name = 'TestAG'
InstanceName = $Node.InstanceName
ServerName = $Node.NodeName
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions Examples/Resources/SqlAG/3-CreateAvailabilityGroupDetailed.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Configuration Example
param(
[Parameter(Mandatory = $true)]
[PSCredential]
$SysAdminAccount
$SqlAdministratorCredential
)

Import-DscResource -ModuleName SqlServerDsc
Expand All @@ -65,7 +65,7 @@ Configuration Example
LoginType = 'WindowsUser'
ServerName = $Node.NodeName
InstanceName = $Node.InstanceName
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}

# Add the required permissions to the cluster service login
Expand All @@ -77,7 +77,7 @@ Configuration Example
InstanceName = $Node.InstanceName
Principal = 'NT SERVICE\ClusSvc'
Permission = 'AlterAnyAvailabilityGroup', 'ViewServerState'
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}

# Create a DatabaseMirroring endpoint
Expand All @@ -88,7 +88,7 @@ Configuration Example
Port = 5022
ServerName = $Node.NodeName
InstanceName = $Node.InstanceName
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}

if ( $Node.Role -eq 'PrimaryReplica' )
Expand Down Expand Up @@ -116,7 +116,7 @@ Configuration Example
DtcSupportEnabled = $Node.DtcSupportEnabled

DependsOn = '[SqlServerEndpoint]HADREndpoint', '[SqlServerPermission]AddNTServiceClusSvcPermissions'
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Configuration Example
param(
[Parameter(Mandatory = $true)]
[PSCredential]
$SysAdminAccount
$SqlAdministratorCredential
)

Import-DscResource -ModuleName SqlServerDsc
Expand All @@ -57,7 +57,7 @@ Configuration Example
LoginType = 'WindowsUser'
ServerName = $Node.NodeName
InstanceName = $Node.SQLInstanceName
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}

# Add the required permissions to the cluster service login
Expand All @@ -69,7 +69,7 @@ Configuration Example
InstanceName = $Node.SqlInstanceName
Principal = 'NT SERVICE\ClusSvc'
Permission = 'AlterAnyAvailabilityGroup', 'ViewServerState'
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}

# Create a DatabaseMirroring endpoint
Expand All @@ -80,7 +80,7 @@ Configuration Example
Port = 5022
ServerName = $Node.NodeName
InstanceName = $Node.SQLInstanceName
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}

if ( $Node.Role -eq 'PrimaryReplica' )
Expand All @@ -93,7 +93,7 @@ Configuration Example
InstanceName = $Node.SQLInstanceName
ServerName = $Node.NodeName
DependsOn = '[SqlServerEndpoint]HADREndpoint', '[SqlServerPermission]AddNTServiceClusSvcPermissions'
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}
}

Expand Down Expand Up @@ -123,7 +123,7 @@ Configuration Example
ServerName = $Node.NodeName
Ensure = 'Present'
ProcessOnlyOnActiveNode = $true
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Configuration Example
param(
[Parameter(Mandatory = $true)]
[PSCredential]
$SysAdminAccount
$SqlAdministratorCredential
)

Import-DscResource -ModuleName SqlServerDsc
Expand All @@ -53,7 +53,7 @@ Configuration Example
LoginType = 'WindowsUser'
ServerName = $Node.NodeName
InstanceName = $Node.SQLInstanceName
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}

# Add the required permissions to the cluster service login
Expand All @@ -65,7 +65,7 @@ Configuration Example
InstanceName = $Node.SqlInstanceName
Principal = 'NT SERVICE\ClusSvc'
Permission = 'AlterAnyAvailabilityGroup', 'ViewServerState'
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}

# Create a DatabaseMirroring endpoint
Expand All @@ -76,7 +76,7 @@ Configuration Example
Port = 5022
ServerName = $Node.NodeName
InstanceName = $Node.SQLInstanceName
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}

if ( $Node.Role -eq 'PrimaryReplica' )
Expand All @@ -89,7 +89,7 @@ Configuration Example
InstanceName = $Node.SQLInstanceName
ServerName = $Node.NodeName
DependsOn = '[SqlServerEndpoint]HADREndpoint', '[SqlServerPermission]AddNTServiceClusSvcPermissions'
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}
}

Expand Down Expand Up @@ -118,7 +118,7 @@ Configuration Example
InstanceName = $Node.SQLInstanceName
ServerName = $Node.NodeName
Ensure = 'Absent'
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Configuration Example
param(
[Parameter(Mandatory = $true)]
[PSCredential]
$SysAdminAccount
$SqlAdministratorCredential
)

Import-DscResource -ModuleName SqlServerDsc
Expand All @@ -53,7 +53,7 @@ Configuration Example
LoginType = 'WindowsUser'
ServerName = $Node.NodeName
InstanceName = $Node.SQLInstanceName
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}

# Add the required permissions to the cluster service login
Expand All @@ -65,7 +65,7 @@ Configuration Example
InstanceName = $Node.SqlInstanceName
Principal = 'NT SERVICE\ClusSvc'
Permission = 'AlterAnyAvailabilityGroup', 'ViewServerState'
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}

# Create a DatabaseMirroring endpoint
Expand All @@ -76,7 +76,7 @@ Configuration Example
Port = 5022
ServerName = $Node.NodeName
InstanceName = $Node.SQLInstanceName
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}

if ( $Node.Role -eq 'PrimaryReplica' )
Expand All @@ -89,7 +89,7 @@ Configuration Example
InstanceName = $Node.SQLInstanceName
ServerName = $Node.NodeName
DependsOn = '[SqlServerEndpoint]HADREndpoint', '[SqlServerPermission]AddNTServiceClusSvcPermissions'
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}
}

Expand Down Expand Up @@ -119,7 +119,7 @@ Configuration Example
ServerName = $Node.NodeName
Ensure = 'Present'
Force = $true
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ Configuration Example
(
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$SysAdminAccount
$SqlAdministratorCredential
)

Import-DscResource -ModuleName SqlServerDsc
Expand All @@ -26,7 +25,7 @@ Configuration Example
IpAddress = '192.168.0.73/255.255.255.0'
Port = 5301

PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ Configuration Example
(
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$SysAdminAccount
$SqlAdministratorCredential
)

Import-DscResource -ModuleName SqlServerDsc
Expand All @@ -26,7 +25,7 @@ Configuration Example
IpAddress = '192.168.0.74/255.255.255.0'
Port = 5302

PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ Configuration Example
(
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$SysAdminAccount
$SqlAdministratorCredential
)

Import-DscResource -ModuleName SqlServerDsc
Expand All @@ -24,7 +23,7 @@ Configuration Example
AvailabilityGroup = 'AvailabilityGroup-01'
Name = 'AG-01'

PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ Configuration Example
(
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$SysAdminAccount
$SqlAdministratorCredential
)

Import-DscResource -ModuleName SqlServerDsc
Expand All @@ -24,7 +23,7 @@ Configuration Example
AvailabilityGroup = 'AG-01'
Name = "AG-01"

PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ Configuration Example
(
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$SysAdminAccount
$SqlAdministratorCredential
)

Import-DscResource -ModuleName SqlServerDsc
Expand All @@ -26,7 +25,7 @@ Configuration Example
DHCP = $true # Also not specifying parameter DHCP will default to using DHCP with the default server subnet.
Port = 5301

PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ Configuration Example
(
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$SysAdminAccount
$SqlAdministratorCredential
)

Import-DscResource -ModuleName SqlServerDsc
Expand All @@ -27,7 +26,7 @@ Configuration Example
IpAddress = '192.168.0.1/255.255.252.0'
Port = 5301

PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}
Loading

0 comments on commit c91e6d6

Please sign in to comment.