SqlServerConfiguration - johlju/SqlServerDsc GitHub Wiki
SqlServerConfiguration
Parameters
| Parameter | Attribute | DataType | Description | Allowed Values |
|---|---|---|---|---|
| InstanceName | Key | String | Name of the SQL instance to be configured. | |
| OptionName | Key | String | The name of the SQL configuration option to be checked. | |
| OptionValue | Required | SInt32 | The desired value of the SQL configuration option. | |
| ServerName | Write | String | The hostname of the SQL Server to be configured. Default value is $env:COMPUTERNAME. | |
| RestartService | Write | Boolean | Determines whether the instance should be restarted after updating the configuration option. | |
| RestartTimeout | Write | UInt32 | The length of time, in seconds, to wait for the service to restart. Default is 120 seconds. |
Description
The SqlConfiguration DSC resource manages the SQL Server Configuration Options
on a SQL Server instance.
Requirements
- Target machine must be running Windows Server 2012 or later.
- Target machine must be running SQL Server Database Engine 2012 or later.
Known issues
All issues are not listed here, see here for all open issues.
Examples
Example 1
This example shows how to configure two SQL Server instances on the same server to have CLR enabled.
.NOTES To get all available options run sp_configure on the SQL Server instance, or refer to https://msdn.microsoft.com/en-us/library/ms189631.aspx
Configuration Example
{
Import-DscResource -ModuleName 'SqlServerDsc'
node localhost
{
foreach ($sqlInstance in @('CONTENT', 'DIST'))
{
SqlServerConfiguration ('SQLConfigCLR_{0}' -f $sqlInstance)
{
ServerName = $Node.NodeName
InstanceName = $sqlInstance
OptionName = 'clr enabled'
OptionValue = 1
}
}
}
}
Example 2
This example shows how to configure two SQL Server instances on the same server to have the setting 'priority boost' enabled.
.NOTES To get all available options run sp_configure on the SQL Server instance, or refer to https://msdn.microsoft.com/en-us/library/ms189631.aspx
Configuration Example
{
Import-DscResource -ModuleName 'SqlServerDsc'
node localhost
{
SqlServerConfiguration 'SQLConfigPriorityBoost'
{
ServerName = 'localhost'
InstanceName = 'MSSQLSERVER'
OptionName = 'priority boost'
OptionValue = 1
RestartService = $false
}
}
}