Examples/Resources/xSQLServerConfiguration/1-ConfigureTwoInstancesOnTheSameServerToEnableClr.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<#
.EXAMPLE
    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
#>


$configurationData = @{
    AllNodes = @(
        @{
            NodeName     = 'localhost'
            SQLInstances = @('CONTENT', 'DIST')
            OptionName   = 'clr enabled'
        }
    )
}

Configuration Example
{
    Import-DscResource -ModuleName xSqlServer

    node localhost
    {
        foreach ($SQLInstance in $node.SQLInstances)
        {
            xSQLServerConfiguration ('SQLConfigCLR_{0}' -f $SQLInstance)
            {
                SQLServer       = $node.NodeName
                SQLInstanceName = $SQLInstance
                OptionName      = $node.OptionName
                OptionValue     = 1
            }
        }
    }
}