Skip to content

Commit

Permalink
[dsccommunity#1258] Added conditional execution of InitializeReportSe…
Browse files Browse the repository at this point in the history
…rver
  • Loading branch information
bozho committed Apr 26, 2019
1 parent 4c249f5 commit 98f0beb
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions DSCResources/MSFT_SqlRS/MSFT_SqlRS.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -445,15 +445,26 @@ function Set-TargetResource

Invoke-RsCimMethod @invokeRsCimMethodParameters

<#
There is no need to execute `InitializeReportServer` CIM method
here, since executing `SetDatabaseConnection` CIM method initializes
Reporting Services.
$reportingServicesData = Get-ReportingServicesData -InstanceName $InstanceName

A call to `InitializeReportServer` method here will fail on
SQL Standard and lower editions, as Reporting Services will try
to configure scale-out deployment.
<#
Only execute InitializeReportServer if SetDatabaseConnection hasn't
initialized Reporting Services already. Otherwise, executing
InitializeReportServer will fail on SQL Server Standard and
lower editions.
#>
if ( -not $reportingServicesData.Configuration.IsInitialized )
{
$invokeRsCimMethodParameters = @{
CimInstance = $reportingServicesData.Configuration
MethodName = 'InitializeReportServer'
Arguments = @{
InstallationId = $reportingServicesData.Configuration.InstallationID
}
}

Invoke-RsCimMethod @invokeRsCimMethodParameters
}

if ( $PSBoundParameters.ContainsKey('UseSsl') -and $UseSsl -ne $currentConfig.UseSsl )
{
Expand Down

0 comments on commit 98f0beb

Please sign in to comment.