forked from dsccommunity/SqlServerDsc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4-CompleteWithTwoInstances.ps1
120 lines (101 loc) · 4.08 KB
/
4-CompleteWithTwoInstances.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<#
.DESCRIPTION
This example installs to instances where the first named instance is used for
the Reporting Services databases, and the second named instance is used for
Reporting Services. After installing the two instances, the configuration
performs a default SQL Server Reporting Services configuration. It will
initialize SQL Server Reporting Services and register the default
Report Server Web Service and Report Manager URLs:
Report Manager: http://localhost:80/Reports_RS
Report Server Web Service: http://localhost:80/ReportServer_RS
#>
Configuration Example
{
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
$SqlAdministratorCredential,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
$SqlInstallCredential,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
$SqlServiceCredential,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
$SqlAgentServiceCredential,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
$ReportingServicesServiceCredential
)
Import-DscResource -ModuleName PSDscResources -ModuleVersion '2.12.0.0'
Import-DscResource -ModuleName 'SqlServerDsc'
Node localhost
{
WindowsFeature 'NetFramework45'
{
Name = 'NET-Framework-45-Core'
Ensure = 'Present'
}
SqlSetup 'InstallDatabaseEngine'
{
InstanceName = 'RSDB'
Features = 'SQLENGINE'
SourcePath = 'Z:\Sql2016Media'
BrowserSvcStartupType = 'Automatic'
SQLCollation = 'Finnish_Swedish_CI_AS'
SQLSvcAccount = $SqlServiceCredential
AgtSvcAccount = $SqlAgentServiceCredential
InstallSharedDir = 'C:\Program Files\Microsoft SQL Server'
InstallSharedWOWDir = 'C:\Program Files (x86)\Microsoft SQL Server'
UpdateEnabled = 'False'
SQLSysAdminAccounts = @(
$SqlAdministratorCredential.UserName
)
PsDscRunAsCredential = $SqlInstallCredential
DependsOn = @(
'[WindowsFeature]NetFramework45'
)
}
SqlSetup 'InstallReportingServicesInstance'
{
InstanceName = 'RS'
Features = 'RS'
SourcePath = 'Z:\Sql2016Media'
BrowserSvcStartupType = 'Automatic'
RSSvcAccount = $ReportingServicesServiceCredential
InstallSharedDir = 'C:\Program Files\Microsoft SQL Server'
InstallSharedWOWDir = 'C:\Program Files (x86)\Microsoft SQL Server'
UpdateEnabled = 'False'
PsDscRunAsCredential = $SqlInstallCredential
DependsOn = @(
'[WindowsFeature]NetFramework45'
'[SqlSetup]InstallDatabaseEngine'
)
}
SqlRS 'ConfigureReportingServiceInstance'
{
# Instance name for the Reporting Services.
InstanceName = 'RS'
<#
Instance for Reporting Services databases.
Tge value $env:COMPUTERNAME can only be used if the configuration
is compiled on the node that should contain the instance 'RSDB'.
If not, set to the node name.
#>
DatabaseServerName = $env:COMPUTERNAME
DatabaseInstanceName = 'RSDB'
PsDscRunAsCredential = $SqlInstallCredential
DependsOn = @(
'[SqlSetup]InstallReportingServicesInstance'
)
}
}
}