Skip to content

Commit

Permalink
Merge pull request #1094 from PowerShell/dev
Browse files Browse the repository at this point in the history
Release of version 11.1.0.0 of SqlServerDsc
  • Loading branch information
kwirkykat authored Mar 21, 2018
2 parents 026102d + 244634e commit 4a68bac
Show file tree
Hide file tree
Showing 16 changed files with 1,240 additions and 1,198 deletions.
56 changes: 47 additions & 9 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,55 @@
<!--
Your feedback and support is greatly appreciated, thanks for contributing!
Your feedback and support is greatly appreciated, thanks for contributing!
Please prefix the issue title with the resource name, i.e. 'SqlSetup: Short description of my issue'
Please provide the following information regarding your issue (place N/A if the fields that don't apply to your issue):
ISSUE TITLE:
Please prefix the issue title with the resource name, i.e.
'SqlSetup: Short description of my issue'
If you like to contribute more please feel free to read the contributing section at https://github.com/PowerShell/SQLServerDsc#contributing.
ISSUE DESCRIPTION (this template):
Please provide information regarding your issue under each header below.
PLEASE KEEP THE HEADERS. Write N/A under any headers that don't apply to your issue.
Any sensitive information can (and should) be obfuscated.
You may remove this and the other comments, but again, please keep the headers.
Note: If you are running the old xSQLServer resource module, then please make sure
the problem is reproducible in the new SqlServerDsc resource module.
If you like to contribute more please feel free to read the contributing section
at https://github.com/PowerShell/SQLServerDsc#contributing.
-->
**Details of the scenario you tried and the problem that is occurring:**
#### Details of the scenario you tried and the problem that is occurring

**The DSC configuration that is using the resource (as detailed as possible):**
#### The DSC configuration that is using the resource (as detailed as possible)
```
<add configuration here>
```

#### Version of the operating system and PowerShell the target node is running
<!--
To help with this information, please run this command:
Get-CimInstance -ClassName 'Win32_OperatingSystem' | ft Caption,OSArchitecture,Version,MUILanguages,{$PSVersionTable.PSVersion}
-->

**Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:**
#### SQL Server edition and version the target node is running
<!--
To help with this information, please run the below commands:
$registryPath = 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server'
$sqlInstance = (Get-ItemProperty -Path $registryPath -ErrorAction 'SilentlyContinue').InstalledInstances
$sqlInstance | ForEach-Object -Process {
$instanceId = (Get-ItemProperty "$registryPath\Instance Names\SQL" -ErrorAction 'SilentlyContinue').$_
(Get-ItemProperty "$registryPath\$instanceId\Setup" -ErrorAction 'SilentlyContinue') | fl Edition,Version, Language
}
-->

**What module (SqlServer or SQLPS) and which version of the module the DSC Target Node is running:**
#### What SQL Server PowerShell modules, and which version, are present on the target node.
<!--
To help with this information, please run this command:
Get-Module -Name '*sql*' -ListAvailable | ? Name -ne 'SqlServerDsc' | ft Name,Version,Path
-->

**Version of the DSC module you're using, or 'dev' if you're using current dev branch:**
#### Version of the DSC module you're using, or write 'dev' if you're using current dev branch
<!--
To help with this information, please run this command:
Get-Module -Name 'SqlServerDsc' -ListAvailable | ft Name,Version,Path
-->
67 changes: 45 additions & 22 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,53 @@
<!--
Thanks for submitting a Pull Request (PR) to this project.
Your contribution to this project is greatly appreciated!
Thanks for submitting a Pull Request (PR) to this project.
Your contribution to this project is greatly appreciated!
Please make sure you have read the contributing section
at https://github.com/PowerShell/SqlServerDsc#contributing.
Please make sure you have read the contributing section
at https://github.com/PowerShell/SqlServerDsc#contributing.
Please prefix the PR title with the resource name,
i.e. 'SqlSetup: My short description'
If this is a breaking change, then also prefix the PR title
with 'BREAKING CHANGE:',
i.e. 'BREAKING CHANGE: SqlSetup: My short description'
Please prefix the PR title with the resource name,
i.e. 'SqlSetup: My short description'.
If this is a breaking change, then also prefix the PR title
with 'BREAKING CHANGE:',
i.e. 'BREAKING CHANGE: SqlSetup: My short description'.
You may remove this and the other comments, but please keep the headers
and the task list.
-->
#### Pull Request (PR) description
<!--
Replace this comment with a description of your pull request.
-->
**Pull Request (PR) description**
<!-- Replace this with a description of your pull request -->

**This Pull Request (PR) fixes the following issues:**
<!-- Replace this with the list of issues or n/a. Use format: Fixes #123 -->
#### This Pull Request (PR) fixes the following issues
<!--
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
-->

**Task list:**
#### Task list
<!--
To aid community reviewers in reviewing and merging your pull request (PR), please take
the time to run through the below checklist.
Change to [x] for each task in the task list that applies to your pull request (PR).
To aid community reviewers in reviewing and merging your pull request (PR),
please take the time to run through the below checklist.
Change to [x] for each task in the task list that applies to your pull
request (PR). For those task that don't apply to you pull request (PR),
leave those as is.
-->
- [ ] Change details added to Unreleased section of CHANGELOG.md?
- [ ] Added/updated documentation, comment-based help and descriptions in .schema.mof files where appropriate?
- [ ] Examples appropriately updated?
- [ ] New/changed code adheres to [Style Guidelines](https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md)?
- [ ] [Unit and (optional) Integration tests](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md) created/updated where possible?
- [ ] Added an entry under the Unreleased section in the CHANGELOG.md? Entry
should say what was changed, and how that affects users (if applicable).
- [ ] Resource documentation added/updated in README.md?
- [ ] Resource parameter descriptions added/updated in README.md, schema.mof
and comment-based help?
- [ ] Comment-based help added/updated?
- [ ] Localization strings added/updated in all localization files as appropriate?
- [ ] Examples appropriately added/updated?
- [ ] Unit tests added/updated?
See [DSC Resource Testing Guidelines](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md).
- [ ] Integration tests added/updated (where possible)?
See [DSC Resource Testing Guidelines](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md).
- [ ] New/changed code adheres to
[DSC Resource Style Guidelines](https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md)
and [Best Practices](https://github.com/PowerShell/DscResources/blob/master/BestPractices.md)?
69 changes: 49 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@

## Unreleased

## 11.1.0.0

- Changes to SqlServerDsc
- Updated the PULL\_REQUEST\_TEMPLATE with an improved task list and modified
some text to be clearer ([issue #973](https://github.com/PowerShell/SqlServerDsc/issues/973)).
- Updated the ISSUE_TEMPLATE to hopefully be more intuitive and easier to use.
- Added information to ISSUE_TEMPLATE that issues must be reproducible in
SqlServerDsc resource module (if running the older xSQLServer resource module)
([issue #1036](https://github.com/PowerShell/SqlServerDsc/issues/1036)).
- Updated ISSUE_TEMPLATE.md with a note about sensitive information ([issue #1092](https://github.com/PowerShell/SqlServerDsc/issues/1092)).
- Changes to SqlServerLogin
- [Claudio Spizzi (@claudiospizzi)](https://github.com/claudiospizzi): Fix password
test fails for nativ sql users ([issue #1048](https://github.com/PowerShell/SqlServerDsc/issues/1048)).
- Changes to SqlSetup
- [Michael Fyffe (@TraGicCode)](https://github.com/TraGicCode): Clarify usage
of 'SecurityMode' along with adding parameter validations for the only 2
supported values ([issue #1010](https://github.com/PowerShell/SqlServerDsc/issues/1010)).
- Now accounts containing '$' will be able to be used for installing
SQL Server. Although, if the account ends with '$' it is considered a
Managed Service Account ([issue #1055](https://github.com/PowerShell/SqlServerDsc/issues/1055)).
- Changes to Integration Tests
- [Michael Fyffe (@TraGicCode)](https://github.com/TraGicCode): Replace xStorage
dsc resource module with StorageDsc ([issue #1038](https://github.com/PowerShell/SqlServerDsc/issues/1038)).
- Changes to Unit Tests
- [Michael Fyffe (@TraGicCode)](https://github.com/TraGicCode): Updated
the following resources unit test template to version 1.2.1
- SqlAlias ([issue #999](https://github.com/PowerShell/SqlServerDsc/issues/999)).
- SqlWindowsFirewall ([issue #1089](https://github.com/PowerShell/SqlServerDsc/issues/1089)).

## 11.0.0.0

- Changes to SqlServerDsc
Expand Down Expand Up @@ -565,10 +594,10 @@
SHIFT+ALT+F, or press F1 and choose 'Format document' in the list. The
PowerShell code will then be formatted according to the Style Guideline
(although maybe not complete, but would help a long way).
- Removed powershell.codeFormatting.alignPropertyValuePairs setting since
it does not align with the style guideline.
- Added powershell.codeFormatting.preset with a value of 'Custom' so that
workspace formatting settings are honored (issue #665).
- Removed powershell.codeFormatting.alignPropertyValuePairs setting since
it does not align with the style guideline.
- Added powershell.codeFormatting.preset with a value of 'Custom' so that
workspace formatting settings are honored (issue #665).
- Fixed lint error MD013 and MD036 in README.md.
- Updated .markdownlint.json to enable rule MD013 and MD036 to enforce those
lint markdown rules in the common tests.
Expand Down Expand Up @@ -1033,11 +1062,11 @@
- BREAKING CHANGE: Removed default value "$PSScriptRoot\..\..\" from parameter
SourcePath.
- Old code, that no longer filled any function, has been replaced.
- Function `ResolvePath` has been replaced with
- Function `ResolvePath` has been replaced with
`[Environment]::ExpandEnvironmentVariables($SourcePath)` so that environment
variables still can be used in Source Path.
- Function `NetUse` has been replaced with `New-SmbMapping` and
`Remove-SmbMapping`.
- Function `NetUse` has been replaced with `New-SmbMapping` and
`Remove-SmbMapping`.
- Renamed function `GetSQLVersion` to `Get-SqlMajorVersion`.
- BREAKING CHANGE: Renamed parameter PID to ProductKey to avoid collision with
automatic variable $PID
Expand Down Expand Up @@ -1276,28 +1305,28 @@
- Grant-CNOPerms
- New-ListenerADObject
- xSQLDatabaseRecoveryModel
- Updated Verbose statements to use new function New-VerboseMessage
- Updated Verbose statements to use new function New-VerboseMessage
- xSQLServerDatabase
- Updated Verbose statements to use new function New-VerboseMessage
- Removed ConnectSQL function and replaced with new Connect-SQL function
- Updated Verbose statements to use new function New-VerboseMessage
- Removed ConnectSQL function and replaced with new Connect-SQL function
- xSQLServerDatabaseOwner
- Removed ConnectSQL function and replaced with new Connect-SQL function
- Removed ConnectSQL function and replaced with new Connect-SQL function
- xSQLServerDatabasePermissions
- Removed ConnectSQL function and replaced with new Connect-SQL function
- Removed ConnectSQL function and replaced with new Connect-SQL function
- xSQLServerDatabaseRole
- Removed ConnectSQL function and replaced with new Connect-SQL function
- Removed ConnectSQL function and replaced with new Connect-SQL function
- xSQLServerLogin
- Removed ConnectSQL function and replaced with new Connect-SQL function
- Removed ConnectSQL function and replaced with new Connect-SQL function
- xSQLServerMaxDop
- Updated Verbose statements to use new function New-VerboseMessage
- Removed ConnectSQL function and replaced with new Connect-SQL function
- Updated Verbose statements to use new function New-VerboseMessage
- Removed ConnectSQL function and replaced with new Connect-SQL function
- xSQLServerMemory
- Updated Verbose statements to use new function New-VerboseMessage
- Removed ConnectSQL function and replaced with new Connect-SQL function
- Updated Verbose statements to use new function New-VerboseMessage
- Removed ConnectSQL function and replaced with new Connect-SQL function
- xSQLServerPowerPlan
- Updated Verbose statements to use new function New-VerboseMessage
- Updated Verbose statements to use new function New-VerboseMessage
- Examples
- Added xSQLServerConfiguration resource example
- Added xSQLServerConfiguration resource example

## 1.5.0.0

Expand Down
2 changes: 1 addition & 1 deletion DSCResources/MSFT_SqlServerLogin/MSFT_SqlServerLogin.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ function Test-TargetResource

try
{
Connect-SQL -SQLServer $ServerName -SQLInstanceName $InstanceName -SetupCredential $userCredential | Out-Null
Connect-SQL -SQLServer $ServerName -SQLInstanceName $InstanceName -SetupCredential $userCredential -LoginType 'SqlLogin' | Out-Null
}
catch
{
Expand Down
16 changes: 13 additions & 3 deletions DSCResources/MSFT_SqlSetup/MSFT_SqlSetup.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,10 @@ function Get-TargetResource
Array of accounts to be made SQL administrators.
.PARAMETER SecurityMode
Security mode to apply to the SQL Server instance.
Security mode to apply to the
SQL Server instance. 'SQL' indicates mixed-mode authentication while
'Windows' indicates Windows authentication.
Default is Windows. { *Windows* | SQL }
.PARAMETER SAPwd
SA password, if SecurityMode is set to 'SQL'.
Expand Down Expand Up @@ -753,6 +756,7 @@ function Set-TargetResource
$SQLSysAdminAccounts,

[Parameter()]
[ValidateSet('SQL', 'Windows')]
[System.String]
$SecurityMode,

Expand Down Expand Up @@ -1525,7 +1529,10 @@ function Set-TargetResource
Array of accounts to be made SQL administrators.
.PARAMETER SecurityMode
Security mode to apply to the SQL Server instance.
Security mode to apply to the
SQL Server instance. 'SQL' indicates mixed-mode authentication while
'Windows' indicates Windows authentication.
Default is Windows. { *Windows* | SQL }
.PARAMETER SAPwd
SA password, if SecurityMode is set to 'SQL'.
Expand Down Expand Up @@ -1691,6 +1698,7 @@ function Test-TargetResource
$SQLSysAdminAccounts,

[Parameter()]
[ValidateSet('SQL', 'Windows')]
[System.String]
$SecurityMode,

Expand Down Expand Up @@ -2113,13 +2121,15 @@ function Get-ServiceAccountParameters
}
}

'.*\$'
# Testing if account is a Managed Service Account, which ends with '$'.
'\$$'
{
$parameters = @{
"$($ServiceType)SVCACCOUNT" = $ServiceAccount.UserName
}
}

# Normal local or domain service account.
default
{
$parameters = @{
Expand Down
2 changes: 1 addition & 1 deletion DSCResources/MSFT_SqlSetup/MSFT_SqlSetup.schema.mof
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MSFT_SqlSetup : OMI_BaseResource
[Read, Description("Output username for the SQL Agent service.")] String AgtSvcAccountUsername;
[Write, Description("Collation for SQL.")] String SQLCollation;
[Write, Description("Array of accounts to be made SQL administrators.")] String SQLSysAdminAccounts[];
[Write, Description("Security mode to apply to the SQL Server instance.")] String SecurityMode;
[Write, Description("Security mode to apply to the SQL Server instance. 'SQL' indicates mixed-mode authentication while 'Windows' indicates Windows authentication. Default is Windows."), ValueMap{"SQL", "Windows"}, Values{"SQL", "Windows"}] String SecurityMode;
[Write, EmbeddedInstance("MSFT_Credential"), Description("SA password, if SecurityMode is set to 'SQL'.")] String SAPwd;
[Write, Description("Root path for SQL database files.")] String InstallSQLDataDir;
[Write, Description("Path for SQL database files.")] String SQLUserDBDir;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
(Windows Server 2012 R2 and earlier) or cluster role (Windows Server 2016 and later). Also so that the
Virtual Computer Object (VCO) can be removed when the Failover CLuster instance is uninstalled.
See the DSC resources xFailoverCluster, xStorage and iSCSIDsc for information how to setup a failover cluster
See the DSC resources xFailoverCluster, StorageDsc and iSCSIDsc for information how to setup a failover cluster
with DSC.
The resource is run using the SYSTEM account, but the setup is run using impersonation, with the credentials in
Expand Down
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ cluster. This is a limitation of SQL Server. See article
[You cannot add or remove features to a SQL Server 2008, SQL Server 2008 R2, or
SQL Server 2012 failover cluster](https://support.microsoft.com/en-us/help/2547273/you-cannot-add-or-remove-features-to-a-sql-server-2008,-sql-server-2008-r2,-or-sql-server-2012-failover-cluster).

#### Credentials
#### Credentials for running the resource

##### PsDscRunAsCredential

Expand All @@ -1470,6 +1470,21 @@ performed by the SYSTEM account. When installing as the SYSTEM account, then
parameter SQLSysAdminAccounts and ASSysAdminAccounts must be specified when
installing feature Database Engine and Analysis Services respectively.

#### Credentials for service accounts

##### Service Accounts

Service account username containing dollar sign ('$') is allowed, but if the
dollar sign is at the end of the username it will be considered a Managed Service
Account.

##### Managed Service Accounts

If a service account username has a dollar sign at the end of the name it will
be considered a Managed Service Account. Any password passed in
the credential object will be ignored, meaning the account is not expected to
need a '*SVCPASSWORD' argument in the setup arguments.

#### Parameters

* **`[String]` Action** _(Write)_: The action to be performed. Defaults to 'Install'.
Expand Down Expand Up @@ -1513,8 +1528,10 @@ installing feature Database Engine and Analysis Services respectively.
* **`[String]` SQLCollation** _(Write)_: Collation for SQL.
* **`[String[]]` SQLSysAdminAccounts** _(Write)_: Array of accounts to be made SQL
administrators.
* **`[String]` SecurityMode** _(Write)_: Security mode to apply to the SQL Server
instance.
* **`[String]` SecurityMode** _(Write)_: Security mode to apply to the
SQL Server instance. 'SQL' indicates mixed-mode authentication while
'Windows' indicates Windows authentication.
Default is Windows. { *Windows* | SQL }
* **`[PSCredential]` SAPwd** _(Write)_: SA password, if SecurityMode is set to 'SQL'.
* **`[String]` InstallSQLDataDir** _(Write)_: Root path for SQL database files.
* **`[String]` SQLUserDBDir** _(Write)_: Path for SQL database files.
Expand Down
Loading

0 comments on commit 4a68bac

Please sign in to comment.