forked from dsccommunity/SqlServerDsc
-
Notifications
You must be signed in to change notification settings - Fork 2
SqlConfiguration
johlju edited this page Jun 19, 2020
·
1 revision
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. |
The SqlConfiguration
DSC resource manages the SQL Server Configuration Options
on a SQL Server instance.
- Target machine must be running Windows Server 2012 or later.
- Target machine must be running SQL Server Database Engine 2012 or later.
All issues are not listed here, see here for all open issues.
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'))
{
SqlConfiguration ('SQLConfigCLR_{0}' -f $sqlInstance)
{
ServerName = $Node.NodeName
InstanceName = $sqlInstance
OptionName = 'clr enabled'
OptionValue = 1
}
}
}
}
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
{
SqlConfiguration 'SQLConfigPriorityBoost'
{
ServerName = 'localhost'
InstanceName = 'MSSQLSERVER'
OptionName = 'priority boost'
OptionValue = 1
RestartService = $false
}
}
}
- SqlAG
- SqlAGDatabase
- SqlAgentAlert
- SqlAgentFailsafe
- SqlAgentOperator
- SqlAGListener
- SqlAGReplica
- SqlAlias
- SqlAlwaysOnService
- SqlConfiguration
- SqlDatabase
- SqlDatabaseDefaultLocation
- SqlDatabaseMail
- SqlDatabaseObjectPermission
- SqlDatabaseOwner
- SqlDatabasePermission
- SqlDatabaseRecoveryModel
- SqlDatabaseRole
- SqlDatabaseUser
- SqlEndpoint
- SqlEndpointPermission
- SqlLogin
- SqlMaxDop
- SqlMemory
- SqlPermission
- SqlProtocol
- SqlProtocolTcpIp
- SqlReplication
- SqlRole
- SqlRS
- SqlRSSetup
- SqlScript
- SqlScriptQuery
- SqlSecureConnection
- SqlServerConfiguration
- SqlServerDatabaseMail
- SqlServerEndpoint
- SqlServerEndpointPermission
- SqlServerEndpointState
- SqlServerLogin
- SqlServerMaxDop
- SqlServerMemory
- SqlServerNetwork
- SqlServerPermission
- SqlServerProtocol
- SqlServerProtocolTcpIp
- SqlServerReplication
- SqlServerRole
- SqlServerSecureConnection
- SqlServiceAccount
- SqlSetup
- SqlWaitForAG
- SqlWindowsFirewall