Skip to content

Commit

Permalink
Changes to SqlServerRole
Browse files Browse the repository at this point in the history
- Updated example to add two server roles in the same configuration.
  • Loading branch information
johlju committed Jan 7, 2018
1 parent 60d19e6 commit e7b08c1
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions Examples/Resources/SqlServerRole/1-AddServerRole.ps1
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
<#
.EXAMPLE
This example shows how to ensure that the server role named
AdminSqlforBI is present on instance sqltest.company.local\DSC.
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)]
[PSCredential]
$SysAdminAccount
$SqlAdministratorCredential
)

Import-DscResource -ModuleName SqlServerDsc

node localhost {
SqlServerRole Add_ServerRole_AdminSqlforBI
SqlServerRole Add_ServerRole_MyServerRole1
{
Ensure = 'Present'
ServerRoleName = 'AdminSqlforBI'
ServerRoleName = 'MyServerRole1'
ServerName = 'sqltest.company.local'
InstanceName = 'DSC'
PsDscRunAsCredential = $SysAdminAccount
PsDscRunAsCredential = $SqlAdministratorCredential
}

SqlServerRole Add_ServerRole_MyServerRole1
{
Ensure = 'Present'
ServerRoleName = 'MyServerRole2'
ServerName = 'sqltest.company.local'
InstanceName = 'DSC'
PsDscRunAsCredential = $SqlAdministratorCredential
}
}
}

0 comments on commit e7b08c1

Please sign in to comment.