forked from dsccommunity/SqlServerDsc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3-AddMembersToServerRole.ps1
More file actions
29 lines (26 loc) · 886 Bytes
/
3-AddMembersToServerRole.ps1
File metadata and controls
29 lines (26 loc) · 886 Bytes
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
<#
.EXAMPLE
This example shows how to ensure that the server role named
AdminSqlforBI is present on instance sqltest.company.local\DSC and only logins
CONTOSO\SQLAdmin and CONTOSO\SQLAdminBI are members of this role.
#>
Configuration Example
{
param(
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
$SqlAdministratorCredential
)
Import-DscResource -ModuleName SqlServerDsc
node localhost {
SqlServerRole Add_ServerRole_AdminSqlforBI
{
Ensure = 'Present'
ServerRoleName = 'AdminSqlforBI'
Members = 'CONTOSO\SQLAdmin', 'CONTOSO\SQLAdminBI'
ServerName = 'sqltest.company.local'
InstanceName = 'DSC'
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}