Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8b8a28e
Add service account management for Reporting Services
johlju Jan 8, 2026
f161621
Enhance Set-SqlDscRSUrlReservation with Recreate mode and update tests
johlju Jan 8, 2026
698125b
Refactor Get-SqlDscRSServiceAccount tests to simplify assertions and …
johlju Jan 8, 2026
3579c5c
Update documentation for Get-SqlDscRSConfiguration to clarify CIM ins…
johlju Jan 8, 2026
e7d4cc1
Update parameter set in Set-SqlDscRSServiceAccount tests to include n…
johlju Jan 8, 2026
d9dcd41
Refactor tests for Set-SqlDscRSServiceAccount and Set-SqlDscRSUrlRese…
johlju Jan 8, 2026
d84e3ec
Add CommonTestHelper module import to BeforeAll in integration tests
johlju Jan 8, 2026
633b587
Rename job 'Test_HQRM' to 'Test_QA' and add 'HQRM Test' job with arti…
johlju Jan 8, 2026
7ba9c79
Split the `Test_HQRM` pipeline job into two parallel jobs (`Test_QA` …
johlju Jan 8, 2026
087eff7
Add test to restart Reporting Services service after URL reservation …
johlju Jan 8, 2026
e8062d9
Add integration tests for database rights assignment and update servi…
johlju Jan 8, 2026
72ec4ca
Refactor service account handling in database rights tests to use act…
johlju Jan 8, 2026
3fe77af
Add test to create SQL Server login for new service account in databa…
johlju Jan 8, 2026
19dd26e
Fix parameter usage in New-SqlDscLogin for granting database rights t…
johlju Jan 8, 2026
6882dc3
Refactor database rights test to remove unnecessary error handling fo…
johlju Jan 8, 2026
23430fd
Update dependencies for Reporting Services and BI Report Server integ…
johlju Jan 9, 2026
3df8228
Add Get-SqlDscRSLogPath function and related tests for SQL Server Rep…
johlju Jan 9, 2026
13a3722
Add integration tests for reinitializing Reporting Services after ser…
johlju Jan 9, 2026
56f4c47
Enhance Request-SqlDscRSDatabaseRightsScript to validate UserName for…
johlju Jan 9, 2026
f1a6d52
Refactor error handling in Get-SqlDscRSLogPath function for improved …
johlju Jan 9, 2026
413f09d
Enhance logging in Post.ServiceAccountChange.RS tests to include erro…
johlju Jan 9, 2026
b6bc2a1
Add New-SqlDscRSEncryptionKey and Remove-SqlDscRSEncryptionKey functi…
johlju Jan 9, 2026
60532e2
Fix exception type for invalid UserName format in Request-SqlDscRSDat…
johlju Jan 9, 2026
527ba0e
Enhance Remove-SqlDscRSEncryptionKey test to include encrypted inform…
johlju Jan 9, 2026
e322210
Enhance Remove-SqlDscRSEncryptionKey function to improve error handli…
johlju Jan 9, 2026
7724eb7
Enhance Remove-SqlDscRSEncryptionKey tests to validate successful rem…
johlju Jan 9, 2026
6b0e79f
Skip integration tests for SQL Server 2017 due to encryption key vali…
johlju Jan 9, 2026
12dde57
Refactor error handling in encryption key functions and update integr…
johlju Jan 9, 2026
dd99447
Add wiki article for troubleshooting Power BI Report Server and SQL S…
johlju Jan 9, 2026
4223ca2
Add troubleshooting guide for Power BI Report Server and SQL Server R…
johlju Jan 9, 2026
765559b
Add Remove-SqlDscRSEncryptedInformation function and related tests; r…
johlju Jan 9, 2026
1df2dcf
Refactor error handling in Remove-SqlDscRSEncryptedInformation and Re…
johlju Jan 9, 2026
0b257fd
Add localization strings for Remove-SqlDscRSEncryptedInformation and …
johlju Jan 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added public command `Get-SqlDscRSLogPath` to get the log file folder path
for SQL Server Reporting Services or Power BI Report Server. Returns the
ErrorDumpDirectory from the instance's setup configuration, which can be
used with `Get-ChildItem` and `Get-Content` to access service logs, portal
logs, and memory dumps.
- Added public command `Test-SqlDscRSAccessible` to verify that SQL Server
Reporting Services or Power BI Report Server web sites are accessible.
Supports both CIM configuration input (with dynamic `-Site` parameter) and
Expand Down Expand Up @@ -189,6 +194,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
for SQL Server Reporting Services or Power BI Report Server. Supports waiting
for dependent services, configurable wait time, and accepts pipeline input
from `Get-SqlDscRSConfiguration`.
- Added public commands `Get-SqlDscRSServiceAccount` and
`Set-SqlDscRSServiceAccount` to get and set the Windows service account for
SQL Server Reporting Services or Power BI Report Server. `Set-SqlDscRSServiceAccount`
wraps the `SetWindowsServiceIdentity` CIM method and supports updating encryption
key backups.
- Added public command `Test-SqlDscRSInitialized` to test whether a Reporting
Services instance is initialized by checking the `IsInitialized` property of
the configuration CIM instance
Expand All @@ -200,9 +210,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added public command `Request-SqlDscRSDatabaseUpgradeScript` to generate a
T-SQL script for upgrading the report server database schema. Wraps the
`GenerateDatabaseUpgradeScript` CIM method.
- Added wiki article `Troubleshooting-Report-Server` documenting how to
retrieve and analyze log files and Windows event logs for Power BI Report
Server and SQL Server Reporting Services.

### Changed

- SqlServerDsc
- Split the `Test_HQRM` pipeline job into two parallel jobs (`Test_QA` and
`Test_HQRM`) to reduce overall pipeline execution time by approximately
15 minutes.
- `Install-SqlDscServer`
- **BREAKING CHANGE:** Removed `PrepareImage`, `Upgrade`, `EditionUpgrade`,
`PrepareFailoverCluster`, and `InstallFailoverCluster` parameter sets. Use
Expand Down Expand Up @@ -254,6 +271,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
of the deprecated private function `Get-ProtocolNameProperties`
- `Class-Based Dsc Resource Tests`
- Updated tests for ResourceBase 2.0.
- `Set-SqlDscRSUrlReservation`
- Added separate parameter set `Recreate` with the parameter `RecreateExisting`
to remove and re-add all existing URL reservations for all applications.
This is useful after changing the Windows service account, as URL reservations
are tied to a specific service account and must be recreated to use the new
account. The `Recreate` parameter set does not require `Application` or
`UrlString` parameters.
- Prerequisites Integration Tests
- Added `svc-RS` local Windows user for Reporting Services service account
integration testing.

### Fixed

Expand Down
50 changes: 44 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ stages:
Write-Host "Variable ShouldRunDscResourceIntegrationTests is set to: $shouldRun"
pwsh: true

- job: Test_HQRM
displayName: 'HQRM'
- job: Test_QA
displayName: 'QA Test'
pool:
vmImage: 'windows-latest'
timeoutInMinutes: '0'
Expand Down Expand Up @@ -147,10 +147,25 @@ stages:
Invoke-Pester -Configuration $pesterConfig
name: qualityTest
displayName: 'Run SqlServerDsc QA Test'

- job: Test_HQRM
displayName: 'HQRM Test'
pool:
vmImage: 'windows-latest'
timeoutInMinutes: '0'
variables:
# This sets environment variable $env:SqlServerDscCI.
SqlServerDscCI: true
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'
- task: PowerShell@2
name: test
displayName: 'Run HQRM Test'
condition: succeededOrFailed()
inputs:
filePath: './build.ps1'
arguments: '-Tasks hqrmtest'
Expand Down Expand Up @@ -481,7 +496,7 @@ stages:

- stage: Integration_Test_Commands_ReportingServices
displayName: 'Integration Test Commands - Reporting Services'
dependsOn: Integration_Test_Commands_SqlServer
dependsOn: Build #Integration_Test_Commands_SqlServer
jobs:
- job: Test_Integration
displayName: 'Commands'
Expand Down Expand Up @@ -551,16 +566,28 @@ stages:
'tests/Integration/Commands/Get-SqlDscRSUrlReservation.Integration.Tests.ps1'
'tests/Integration/Commands/Set-SqlDscRSUrlReservation.Integration.Tests.ps1'
'tests/Integration/Commands/Set-SqlDscRSDatabaseConnection.Integration.Tests.ps1'
'tests/Integration/Commands/Restart-SqlDscRSService.Integration.Tests.ps1'
'tests/Integration/Commands/Request-SqlDscRSDatabaseUpgradeScript.Integration.Tests.ps1'
'tests/Integration/Commands/Restart-SqlDscRSService.Integration.Tests.ps1'
'tests/Integration/Commands/Test-SqlDscRSInitialized.Integration.Tests.ps1'
'tests/Integration/Commands/Get-SqlDscRSLogPath.Integration.Tests.ps1'
# Group 4
'tests/Integration/Commands/Initialize-SqlDscRS.Integration.Tests.ps1'
# Group 5 - Post-initialization validation
'tests/Integration/Commands/Post.Initialization.RS.Integration.Tests.ps1'
# Group 6 - Service account change
'tests/Integration/Commands/Set-SqlDscRSServiceAccount.Integration.Tests.ps1'
'tests/Integration/Commands/Get-SqlDscRSServiceAccount.Integration.Tests.ps1'
'tests/Integration/Commands/Post.DatabaseRights.RS.Integration.Tests.ps1'
'tests/Integration/Commands/Post.EncryptedInformation.RS.Integration.Tests.ps1'
'tests/Integration/Commands/Remove-SqlDscRSEncryptionKey.Integration.Tests.ps1'
'tests/Integration/Commands/New-SqlDscRSEncryptionKey.Integration.Tests.ps1'
'tests/Integration/Commands/Post.UrlReservationRecreate.RS.Integration.Tests.ps1'
'tests/Integration/Commands/Post.Reinitialize.RS.Integration.Tests.ps1'
'tests/Integration/Commands/Post.ServiceAccountChange.RS.Integration.Tests.ps1'
# Group 8
'tests/Integration/Commands/Repair-SqlDscReportingService.Integration.Tests.ps1'
'tests/Integration/Commands/Remove-SqlDscRSUrlReservation.Integration.Tests.ps1'
'tests/Integration/Commands/Remove-SqlDscRSEncryptedInformation.Integration.Tests.ps1'
# Group 9
'tests/Integration/Commands/Uninstall-SqlDscReportingService.Integration.Tests.ps1'
)
Expand All @@ -576,7 +603,7 @@ stages:

- stage: Integration_Test_Commands_BIReportServer
displayName: 'Integration Test Commands - BI Report Server'
dependsOn: Integration_Test_Commands_SqlServer
dependsOn: Build #Integration_Test_Commands_SqlServer
jobs:
- job: Test_Integration
displayName: 'Commands'
Expand Down Expand Up @@ -637,12 +664,23 @@ stages:
'tests/Integration/Commands/Get-SqlDscRSUrlReservation.Integration.Tests.ps1'
'tests/Integration/Commands/Set-SqlDscRSUrlReservation.Integration.Tests.ps1'
'tests/Integration/Commands/Set-SqlDscRSDatabaseConnection.Integration.Tests.ps1'
'tests/Integration/Commands/Request-SqlDscRSDatabaseUpgradeScript.Integration.Tests.ps1'
'tests/Integration/Commands/Restart-SqlDscRSService.Integration.Tests.ps1'
'tests/Integration/Commands/Test-SqlDscRSInitialized.Integration.Tests.ps1'
'tests/Integration/Commands/Get-SqlDscRSLogPath.Integration.Tests.ps1'
# Group 4
'tests/Integration/Commands/Initialize-SqlDscRS.Integration.Tests.ps1'
# Group 5 - Post-initialization validation
'tests/Integration/Commands/Post.Initialization.RS.Integration.Tests.ps1'
# Group 6 - Service account change
'tests/Integration/Commands/Set-SqlDscRSServiceAccount.Integration.Tests.ps1'
'tests/Integration/Commands/Get-SqlDscRSServiceAccount.Integration.Tests.ps1'
'tests/Integration/Commands/Post.DatabaseRights.RS.Integration.Tests.ps1'
'tests/Integration/Commands/Remove-SqlDscRSEncryptionKey.Integration.Tests.ps1'
'tests/Integration/Commands/New-SqlDscRSEncryptionKey.Integration.Tests.ps1'
'tests/Integration/Commands/Post.UrlReservationRecreate.RS.Integration.Tests.ps1'
'tests/Integration/Commands/Post.Reinitialize.RS.Integration.Tests.ps1'
'tests/Integration/Commands/Post.ServiceAccountChange.RS.Integration.Tests.ps1'
# Group 8
'tests/Integration/Commands/Repair-SqlDscPowerBIReportServer.Integration.Tests.ps1'
'tests/Integration/Commands/Remove-SqlDscRSUrlReservation.Integration.Tests.ps1'
Expand Down
9 changes: 6 additions & 3 deletions source/Public/Get-SqlDscRSConfiguration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
Reporting Services configuration, such as `Enable-SqlDscRsSecureConnection`
and `Disable-SqlDscRsSecureConnection`.

The configuration CIM instance provides access to properties like
`SecureConnectionLevel`, `DatabaseServerName`, `VirtualDirectoryReportServer`,
and methods for managing Reporting Services configuration.
The returned CIM instance provides access to properties documented in
[MSReportServer_ConfigurationSetting](https://learn.microsoft.com/en-us/sql/reporting-services/wmi-provider-library-reference/msreportserver-configurationsetting-properties),
such as `SecureConnectionLevel`, `DatabaseServerName`,
`VirtualDirectoryReportServer`, `WindowsServiceIdentityActual`,
'WindowsServiceIdentityConfigured' and methods for managing Reporting
Services configuration.

.PARAMETER InstanceName
Specifies the name of the Reporting Services instance. This is a
Expand Down
123 changes: 123 additions & 0 deletions source/Public/Get-SqlDscRSLogPath.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<#
.SYNOPSIS
Gets the log file path for SQL Server Reporting Services or Power BI
Report Server.

.DESCRIPTION
Gets the log file folder path for SQL Server Reporting Services (SSRS)
or Power BI Report Server (PBIRS). The returned path is the ErrorDumpDirectory
from the instance's setup configuration, which contains the LogFiles folder
where service logs, portal logs, and memory dumps are stored.

The returned path can be used with `Get-ChildItem` and `Get-Content` to
access and read the log files.

Common log file types in this folder:
- ReportingServicesService*.log - Web service activity logs
- RSPortal*.log - Portal access and activity logs
- SQLDumpr*.mdmp - Memory dumps for error analysis

.PARAMETER InstanceName
Specifies the name of the Reporting Services instance. This is typically
'SSRS' for SQL Server Reporting Services or 'PBIRS' for Power BI Report
Server. This parameter is mandatory when not passing a configuration object.

.PARAMETER Configuration
Specifies the `MSReportServer_ConfigurationSetting` CIM instance for
the Reporting Services instance. This can be obtained using the
`Get-SqlDscRSConfiguration` command. This parameter accepts pipeline
input.

.EXAMPLE
Get-SqlDscRSLogPath -InstanceName 'SSRS'

Returns the log file folder path for the SQL Server Reporting Services
instance 'SSRS'.

.EXAMPLE
Get-SqlDscRSLogPath -InstanceName 'PBIRS'

Returns the log file folder path for the Power BI Report Server
instance 'PBIRS'.

.EXAMPLE
Get-SqlDscRSConfiguration -InstanceName 'SSRS' | Get-SqlDscRSLogPath

Gets the configuration for SSRS and pipes it to Get-SqlDscRSLogPath to
retrieve the log folder path.

.EXAMPLE
Get-SqlDscRSLogPath -InstanceName 'SSRS' | Get-ChildItem -Filter '*.log'

Gets the log path for SSRS and lists all .log files in that folder.

.EXAMPLE
$logPath = Get-SqlDscRSLogPath -InstanceName 'SSRS'
Get-ChildItem -Path $logPath -Filter 'ReportingServicesService*.log' |
Sort-Object -Property LastWriteTime -Descending |
Select-Object -First 1 |
Get-Content -Tail 100

Gets the most recent web service log file and displays the last 100 lines.

.INPUTS
`Microsoft.Management.Infrastructure.CimInstance`

Accepts MSReportServer_ConfigurationSetting CIM instance via pipeline.

.OUTPUTS
`System.String`

Returns the path to the log files folder for the specified Reporting
Services instance.
#>
function Get-SqlDscRSLogPath
{
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('UseSyntacticallyCorrectExamples', '', Justification = 'Because the examples use pipeline input the rule cannot validate.')]
[CmdletBinding(DefaultParameterSetName = 'ByInstanceName')]
[OutputType([System.String])]
param
(
[Parameter(Mandatory = $true, ParameterSetName = 'ByInstanceName')]
[System.String]
$InstanceName,

[Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = 'ByConfiguration')]
[System.Object]
$Configuration
)

process
{
if ($PSCmdlet.ParameterSetName -eq 'ByConfiguration')
{
$InstanceName = $Configuration.InstanceName
}

Write-Verbose -Message ($script:localizedData.Get_SqlDscRSLogPath_GettingPath -f $InstanceName)

$setupConfiguration = Get-SqlDscRSSetupConfiguration -InstanceName $InstanceName

if (-not $setupConfiguration)
{
$errorMessage = $script:localizedData.Get_SqlDscRSLogPath_InstanceNotFound -f $InstanceName

$errorRecord = New-ErrorRecord -Exception (New-InvalidOperationException -Message $errorMessage -PassThru) -ErrorId 'GSRSLP0001' -ErrorCategory 'ObjectNotFound' -TargetObject $InstanceName

$PSCmdlet.ThrowTerminatingError($errorRecord)
}

if ([System.String]::IsNullOrEmpty($setupConfiguration.ErrorDumpDirectory))
{
$errorMessage = $script:localizedData.Get_SqlDscRSLogPath_LogPathNotFound -f $InstanceName

$errorRecord = New-ErrorRecord -Exception (New-InvalidOperationException -Message $errorMessage -PassThru) -ErrorId 'GSRSLP0002' -ErrorCategory 'ObjectNotFound' -TargetObject $InstanceName

$PSCmdlet.ThrowTerminatingError($errorRecord)
}

Write-Verbose -Message ($script:localizedData.Get_SqlDscRSLogPath_FoundPath -f $setupConfiguration.ErrorDumpDirectory)

return $setupConfiguration.ErrorDumpDirectory
}
}
71 changes: 71 additions & 0 deletions source/Public/Get-SqlDscRSServiceAccount.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<#
.SYNOPSIS
Gets the service account for SQL Server Reporting Services.

.DESCRIPTION
Gets the Windows service account for SQL Server Reporting Services or
Power BI Report Server from the `MSReportServer_ConfigurationSetting`
CIM instance.

This command returns the current service account name that is being
used by the Reporting Services Windows service.

The configuration CIM instance can be obtained using the
`Get-SqlDscRSConfiguration` command and passed via the pipeline.

.PARAMETER Configuration
Specifies the `MSReportServer_ConfigurationSetting` CIM instance for
the Reporting Services instance. This can be obtained using the
`Get-SqlDscRSConfiguration` command. This parameter accepts pipeline
input.

.EXAMPLE
Get-SqlDscRSConfiguration -InstanceName 'SSRS' | Get-SqlDscRSServiceAccount

Gets the service account for the Reporting Services instance 'SSRS'.

.EXAMPLE
$config = Get-SqlDscRSConfiguration -InstanceName 'SSRS'
Get-SqlDscRSServiceAccount -Configuration $config

Gets the service account using a stored configuration object.

.INPUTS
`Microsoft.Management.Infrastructure.CimInstance`

Accepts MSReportServer_ConfigurationSetting CIM instance via pipeline.

.OUTPUTS
`System.String`

Returns the service account name.

.NOTES
This is a convenience wrapper around accessing the
`WindowsServiceIdentityActual` property of the configuration CIM
instance.

.LINK
https://docs.microsoft.com/en-us/sql/reporting-services/wmi-provider-library-reference/msreportserver-configurationsetting-properties
#>
function Get-SqlDscRSServiceAccount
{
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('UseSyntacticallyCorrectExamples', '', Justification = 'Because the examples use pipeline input the rule cannot validate.')]
[CmdletBinding()]
[OutputType([System.String])]
param
(
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[System.Object]
$Configuration
)

process
{
$instanceName = $Configuration.InstanceName

Write-Verbose -Message ($script:localizedData.Get_SqlDscRSServiceAccount_Getting -f $instanceName)

return $Configuration.WindowsServiceIdentityActual
}
}
Loading