forked from dsccommunity/SqlServerDsc
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Updated example to add two server roles in the same configuration.
- Loading branch information
Showing
1 changed file
with
16 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} |