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 Oct 2, 2017
1 parent 0e1a7ca commit 00966ee
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
- Added integration test ([issue #753](https://github.com/PowerShell/xSQLServer/issues/753)).
- Added support for configuring URL reservations and virtual directory names
([issue #570](https://github.com/PowerShell/xSQLServer/issues/570))
- Added complete example for xSQLServerRSConfig (based on the integration tests)
([issue #634](https://github.com/PowerShell/xSQLServer/issues/634)).

## 8.1.0.0

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'
)
}
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ Initializes and configures SQL Reporting Services server.

#### Examples

None.
* [Complete example with two instances in default configuration](/Examples/Resources/xSQLServerRSConfig/3-CompleteWithTwoInstances.ps1)

### xSQLServerRSSecureConnectionLevel

Expand Down

0 comments on commit 00966ee

Please sign in to comment.