Skip to content

Commit

Permalink
Changes to xSQLServerRSConfig
Browse files Browse the repository at this point in the history
- Added complete example for xSQLServerRSConfig (based on the integration tests) (issue dsccommunity#634).
  • Loading branch information
johlju committed Dec 6, 2017
1 parent ae6c520 commit 7a82a99
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
- BREAKING CHANGE: Parameters RSSQLServer and RSSQLInstanceName has been renamed
to DatabaseServerName and DatabaseInstanceName respectively
([issue #923](https://github.com/PowerShell/SqlServerDsc/issues/923)).
- Changes to SqlDatabaseRole
- Added complete example for SqlRS (based on the integration tests)
([issue #634](https://github.com/PowerShell/xSQLServer/issues/634)).
- Changes to SqlServerConfiguration
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
Expand Down
139 changes: 139 additions & 0 deletions Examples/Resources/xSQLServerRSConfig/3-CompleteWithTwoInstances.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
<#
.EXAMPLE
This example performs a default SSRS configuration. It will initialize SSRS
and register default Report Server Web Service and Report Manager URLs:
http://localhost:80/ReportServer (Report Server Web Service)
http://localhost:80/Reports (Report Manager)
#>

$ConfigurationData = @{
AllNodes = @(
@{
NodeName = 'localhost'

# This is values used for the Reporting Services instance.
InstanceName = 'RS'
Features = 'RS'

# This is values used for the Database Engine instance.
RSSQLServer = $env:COMPUTERNAME
RSSQLInstanceName = 'RSDB'
RSSQLFeatures = 'SQLENGINE'
RSSQLCollation = 'Finnish_Swedish_CI_AS'

# This is values used for both instances.
MediaPath = 'Z:\Sql2016Media'
InstallSharedDir = 'C:\Program Files\Microsoft SQL Server'
InstallSharedWOWDir = 'C:\Program Files (x86)\Microsoft SQL Server'
UpdateEnabled = 'False'
BrowserSvcStartupType = 'Automatic'

PSDscAllowPlainTextPassword = $true
}
)
}

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 xSqlServer

node localhost {
WindowsFeature 'NetFramework45'
{
Name = 'NET-Framework-45-Core'
Ensure = 'Present'
}

xSQLServerSetup 'InstallDatabaseEngine'
{
InstanceName = $Node.RSSQLInstanceName
Features = $Node.RSSQLFeatures
SourcePath = $Node.MediaPath
BrowserSvcStartupType = $Node.BrowserSvcStartupType
SQLCollation = $Node.RSSQLCollation
SQLSvcAccount = $SqlServiceCredential
AgtSvcAccount = $SqlAgentServiceCredential
InstallSharedDir = $Node.InstallSharedDir
InstallSharedWOWDir = $Node.InstallSharedWOWDir
UpdateEnabled = $Node.UpdateEnabled

SQLSysAdminAccounts = @(
$SqlAdministratorCredential.UserName
)

DependsOn = @(
'[WindowsFeature]NetFramework45'
)

PsDscRunAsCredential = $SqlInstallCredential
}

xSQLServerSetup 'InstallReportingServicesInstance'
{
InstanceName = $Node.InstanceName
Features = $Node.Features
SourcePath = $Node.MediaPath
BrowserSvcStartupType = $Node.BrowserSvcStartupType
RSSvcAccount = $ReportingServicesServiceCredential
InstallSharedDir = $Node.InstallSharedDir
InstallSharedWOWDir = $Node.InstallSharedWOWDir
UpdateEnabled = $Node.UpdateEnabled

SQLSysAdminAccounts = @(
$SqlAdministratorCredential.UserName
)

DependsOn = @(
'[WindowsFeature]NetFramework45'
'[xSQLServerSetup]InstallDatabaseEngine'
)

PsDscRunAsCredential = $SqlInstallCredential
}

xSQLServerRSConfig 'ConfigureReportingServiceInstance'
{
# Instance name for the Reporting Services.
InstanceName = $Node.InstanceName

# Instance for Reporting Services databases.
RSSQLServer = $Node.RSSQLServer
RSSQLInstanceName = $Node.RSSQLInstanceName

PsDscRunAsCredential = $SqlInstallCredential

DependsOn = @(
'[xSQLServerSetup]InstallReportingServicesInstance'
)
}
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,7 @@ Initializes and configures SQL Reporting Services server.

* [Default configuration](Examples/Resources/SqlRS/1-DefaultConfiguration.ps1)
* [Custom virtual directories and reserved URLs](Examples/Resources/SqlRS/2-CustomConfiguration.ps1)
* [Complete example with two instances in default configuration](/Examples/Resources/SqlRS/3-CompleteWithTwoInstances.ps1)

### SqlRSSecureConnectionLevel

Expand Down

0 comments on commit 7a82a99

Please sign in to comment.