Module with DSC resources for deployment and configuration of Microsoft SQL Server.

Minimum PowerShell version


There is a newer prerelease version of this module available.
See the version list below for details.

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name SqlServerDsc -RequiredVersion 13.3.0

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deloy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More


DSC Community


Copyright the DSC Community contributors. All rights reserved.



DesiredStateConfiguration DSC DSCResourceKit DSCResource


SqlAG SqlAGDatabase SqlAgentAlert SqlAgentFailsafe SqlAgentOperator SqlAGListener SqlAGReplica SqlAlias SqlAlwaysOnService SqlDatabase SqlDatabaseDefaultLocation SqlDatabaseOwner SqlDatabasePermission SqlDatabaseRecoveryModel SqlDatabaseRole SqlDatabaseUser SqlRS SqlRSSetup SqlScript SqlScriptQuery SqlServerConfiguration SqlServerDatabaseMail SqlServerEndpoint SqlServerEndpointPermission SqlServerEndpointState SqlServerLogin SqlServerMaxDop SqlServerMemory SqlServerNetwork SqlServerPermission MSFT_SqlServerReplication SqlServerRole SqlServerSecureConnection SqlServiceAccount SqlSetup SqlWaitForAG SqlWindowsFirewall


This module has no dependencies.

Release Notes

# Change log for SqlServerDsc

The format is based on and uses the types of changes according to [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md).

## [Unreleased]

### Added

- SqlServerDsc
 - Added continuous delivery with a new CI pipeline.
   - Update build.ps1 from latest template.

### Changed

- SqlServerDsc
 - Add .gitattributes file to checkout file correctly with CRLF.
 - Updated .vscode/analyzersettings.psd1 file to correct use PSSA rules
   and custom rules in VS Code.
 - Fix hashtables to align with style guideline ([issue #1437](https://github.com/PowerShell/SqlServerDsc/issues/1437)).
 - Updated most examples to remove the need for the variable `$ConfigurationData`,
   and fixed style issues.
 - Ignore commit in `GitVersion.yml` to force the correct initial release.
 - Set a display name on all the jobs and tasks in the CI pipeline.
 - Removing file 'Tests.depend.ps1' as it is no longer required.
- SqlServerMaxDop
 - Fix line endings in code which did not use the correct format.
- SqlAlwaysOnService
 - The integration test has been temporarily disabled because when
   the cluster feature is installed it requires a reboot on the
   Windows Server 2019 build worker.
- SqlDatabaseRole
 - Update unit test to have the correct description on the `Describe`-block
   for the test of `Set-TargetResource`.
- SqlServerRole
 - Add support for nested role membership ([issue #1452](https://github.com/dsccommunity/SqlServerDsc/issues/1452))
 - Removed use of case-sensitive Contains() function when evalutating role membership.
   ([issue #1153](https://github.com/dsccommunity/SqlServerDsc/issues/1153))
 - Refactored mocks and unit tests to increase performance. ([issue #979](https://github.com/dsccommunity/SqlServerDsc/issues/979))

### Fixed

- SqlServerDsc
 - Fixed unit tests to call the function `Invoke-TestSetup` outside the
 - Update GitVersion.yml with the correct regular expression.
 - Fix import statement in all tests, making sure it throws if module
   DscResource.Test cannot be imported.
- SqlAlwaysOnService
 - When failing to enable AlwaysOn the resource should now fail with an
   error ([issue #1190](https://github.com/dsccommunity/SqlServerDsc/issues/1190)).
- SqlAgListener
 - Fix IPv6 addresses failing Test-TargetResource after listener creation.

Version History

Version Downloads Last updated
13.3.1-previ... 12 1/18/2020
13.3.0 (current version) 82,295 1/17/2020
13.3.0-previ... 3 1/17/2020
13.3.0-previ... 10 1/12/2020
13.3.0-previ... 4 1/8/2020
13.3.0-previ... 7 1/7/2020
13.3.0-previ... 3 1/3/2020
13.3.0-previ... 3 1/2/2020
13.3.0-previ... 5 1/2/2020 774,632 9/19/2019 34,065 8/8/2019 25,209 6/26/2019 15,897 5/15/2019 20,770 4/3/2019 39,616 2/20/2019 8,330 1/10/2019 19,323 10/25/2018 13,627 9/5/2018 15,918 7/25/2018 7,023 6/13/2018 3,810 5/2/2018 4,039 3/22/2018 8,049 2/8/2018 3,504 12/14/2017