From 30dab1c1a705ad47e13977dc87225f85b81b0ee6 Mon Sep 17 00:00:00 2001 From: Marko Bozikovic Date: Mon, 29 Mar 2021 21:21:06 +0200 Subject: [PATCH] [#1509] SSRS 2019 initialization fix. --- CHANGELOG.md | 3 +++ source/DSCResources/DSC_SqlRS/DSC_SqlRS.psm1 | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 784b899ee7..772172742d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Changed to the new GitHub deploy tasks that is required for the latest version of the Sampler module. +- SqlRS + - Fixed SSRS 2019 initialisation [issue #1509](https://github.com/dsccommunity/SqlServerDsc/issues/1509). + ## [15.1.1] - 2021-02-12 ### Fixed diff --git a/source/DSCResources/DSC_SqlRS/DSC_SqlRS.psm1 b/source/DSCResources/DSC_SqlRS/DSC_SqlRS.psm1 index fa7183d1af..46f669fde7 100644 --- a/source/DSCResources/DSC_SqlRS/DSC_SqlRS.psm1 +++ b/source/DSCResources/DSC_SqlRS/DSC_SqlRS.psm1 @@ -463,6 +463,18 @@ function Set-TargetResource Invoke-RsCimMethod @invokeRsCimMethodParameters + <# + When initializing SSRS 2019, the call to InitializeReportServer + always fails, even if IsInitialized flag is $false. + It also seems that simply restarting SSRS at this point initializes + it. + + We will ignore $SuppressRestart here. + #> + Write-Verbose -Message $script:localizedData.Restart + Restart-ReportingServicesService -InstanceName $InstanceName -WaitTime 30 + $restartReportingService = $false + $reportingServicesData = Get-ReportingServicesData -InstanceName $InstanceName <# @@ -473,6 +485,8 @@ function Set-TargetResource #> if ( -not $reportingServicesData.Configuration.IsInitialized ) { + $restartReportingService = $true + $invokeRsCimMethodParameters = @{ CimInstance = $reportingServicesData.Configuration MethodName = 'InitializeReportServer' @@ -488,6 +502,8 @@ function Set-TargetResource { Write-Verbose -Message "Changing value for using SSL to '$UseSsl'." + $restartReportingService = $true + $invokeRsCimMethodParameters = @{ CimInstance = $reportingServicesData.Configuration MethodName = 'SetSecureConnectionLevel'