forked from dsccommunity/SqlServerDsc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
1-AddServerRole.ps1
37 lines (33 loc) · 1.06 KB
/
1-AddServerRole.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
37
<#
.EXAMPLE
This example shows how to ensure that both the server role named
MyServerRole1 and MyServerRole2 is present on instance
'sqltest.company.local\DSC'.
#>
Configuration Example
{
param(
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
$SqlAdministratorCredential
)
Import-DscResource -ModuleName SqlServerDsc
node localhost {
SqlServerRole Add_ServerRole_MyServerRole1
{
Ensure = 'Present'
ServerRoleName = 'MyServerRole1'
ServerName = 'sqltest.company.local'
InstanceName = 'DSC'
PsDscRunAsCredential = $SqlAdministratorCredential
}
SqlServerRole Add_ServerRole_MyServerRole2
{
Ensure = 'Present'
ServerRoleName = 'MyServerRole2'
ServerName = 'sqltest.company.local'
InstanceName = 'DSC'
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}