forked from dsccommunity/SqlServerDsc
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path1-AddDatabaseRole.ps1
More file actions
31 lines (29 loc) · 787 Bytes
/
1-AddDatabaseRole.ps1
File metadata and controls
31 lines (29 loc) · 787 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
30
31
<#
.EXAMPLE
This example shows how to ensure that the user account CONTOSO\SQLAdmin
has "MyRole" and "MySecondRole" SQL database roles.
#>
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$SysAdminAccount
)
Import-DscResource -ModuleName xSqlServer
node localhost
{
xSQLServerDatabaseRole Add_Database_Role
{
Ensure = 'Present'
SQLServer = 'SQLServer'
SQLInstanceName = 'DSC'
Name = 'CONTOSO\SQLAdmin'
Role = 'MyRole','MySecondRole'
Database = 'AdventureWorks'
PsDscRunAsCredential = $SysAdminAccount
}
}
}