Get‑SqlDscRSConfigFile - dsccommunity/SqlServerDsc GitHub Wiki

SYNOPSIS

Gets the RsReportServer.config configuration file as an XML object.

SYNTAX

ByInstanceName (Default)

Get-SqlDscRSConfigFile -InstanceName <String> [<CommonParameters>]

ByConfiguration

Get-SqlDscRSConfigFile -SetupConfiguration <Object> [<CommonParameters>]

ByPath

Get-SqlDscRSConfigFile -Path <String> [<CommonParameters>]

DESCRIPTION

Gets the RsReportServer.config configuration file for SQL Server Reporting Services (SSRS) or Power BI Report Server (PBIRS) as an XML document object. This allows programmatic access to configuration settings using standard XML navigation or XPath queries.

The configuration file path is automatically determined from the instance's setup configuration in the registry when using the InstanceName or SetupConfiguration parameter. Alternatively, a direct file path can be specified using the Path parameter.

EXAMPLES

EXAMPLE 1

Get-SqlDscRSConfigFile -InstanceName 'SSRS'

Returns the rsreportserver.config file content as an XML object for the SSRS instance.

EXAMPLE 2

Get-SqlDscRSConfigFile -InstanceName 'PBIRS'

Returns the rsreportserver.config file content as an XML object for the Power BI Report Server instance.

EXAMPLE 3

Get-SqlDscRSSetupConfiguration -InstanceName 'SSRS' | Get-SqlDscRSConfigFile

Gets the setup configuration for SSRS and pipes it to Get-SqlDscRSConfigFile to retrieve the configuration file as XML.

EXAMPLE 4

Get-SqlDscRSConfigFile -Path 'C:\Backup\rsreportserver.config'

Reads the configuration file from the specified path.

EXAMPLE 5

$config = Get-SqlDscRSConfigFile -InstanceName 'SSRS'
$config.Configuration.Service.IsSchedulingService

Gets the config file and accesses the scheduling service setting directly using dot notation.

EXAMPLE 6

$config = Get-SqlDscRSConfigFile -InstanceName 'SSRS'
$config.SelectSingleNode('//Authentication/AuthenticationTypes')

Uses XPath to query the authentication types configuration section.

EXAMPLE 7

$config = Get-SqlDscRSConfigFile -InstanceName 'SSRS'
$config.SelectNodes('//Extension[@Name]') | ForEach-Object { $_.Name }

Uses XPath to list all extension names defined in the configuration.

EXAMPLE 8

$config = Get-SqlDscRSConfigFile -InstanceName 'SSRS'
$config.Configuration.URLReservations.Application |
    Where-Object { $_.Name -eq 'ReportServerWebService' } |
    Select-Object -ExpandProperty URLs

Gets the URL reservations for the Report Server Web Service application.

EXAMPLE 9

$config = Get-SqlDscRSConfigFile -InstanceName 'SSRS'
$smtpServer = $config.SelectSingleNode('//RSEmailDPConfiguration/SMTPServer')
if ($smtpServer) { $smtpServer.InnerText }

Uses XPath to retrieve the SMTP server configuration for email delivery.

PARAMETERS

-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 or a direct path.

Type: String
Parameter Sets: ByInstanceName
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Path

Specifies the direct path to the RsReportServer.config file. Use this parameter to read configuration files from non-standard locations or backup copies.

Type: String
Parameter Sets: ByPath
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SetupConfiguration

Specifies the configuration object from Get-SqlDscRSSetupConfiguration. This can be piped from Get-SqlDscRSSetupConfiguration. The object must have a ConfigFilePath property containing the path to the configuration file. This parameter accepts pipeline input.

Type: Object
Parameter Sets: ByConfiguration
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.Object

Accepts the setup configuration object from Get-SqlDscRSSetupConfiguration via

pipeline.

OUTPUTS

System.Xml.XmlDocument

Returns the configuration file content as an XML document object.

NOTES

For more information about the RsReportServer.config configuration file, see the Microsoft documentation: https://learn.microsoft.com/en-us/sql/reporting-services/report-server/rsreportserver-config-configuration-file

RELATED LINKS

⚠️ **GitHub.com Fallback** ⚠️