Test‑SqlDscRSAccessible - dsccommunity/SqlServerDsc GitHub Wiki

SYNOPSIS

Tests if SQL Server Reporting Services sites are accessible.

SYNTAX

Configuration (Default)

Test-SqlDscRSAccessible -Configuration <Object> [-ServerName <String>] [-TimeoutSeconds <Int32>]
 [-RetryIntervalSeconds <Int32>] [-Detailed] [<CommonParameters>]

Uri

Test-SqlDscRSAccessible [-ReportServerUri <String>] [-ReportsUri <String>] [-TimeoutSeconds <Int32>]
 [-RetryIntervalSeconds <Int32>] [-Detailed] [<CommonParameters>]

DESCRIPTION

Tests if SQL Server Reporting Services or Power BI Report Server web sites are accessible by making HTTP requests to the configured URLs.

This command can be used to verify that a Reporting Services instance is fully configured and responding to web requests after initialization.

The command supports two modes:

  • Configuration mode: Uses a CIM configuration instance to automatically detect the configured URLs from URL reservations.
  • URI mode: Uses explicitly specified URIs for the ReportServer and/or Reports sites.

When using the Configuration parameter set, a dynamic -Site parameter becomes available that allows selecting which sites to test. The available sites are determined from the URL reservations configured for the instance.

EXAMPLES

EXAMPLE 1

Get-SqlDscRSConfiguration -InstanceName 'SSRS' | Test-SqlDscRSAccessible

Tests if all configured sites for the SSRS instance are accessible. Returns $true if all sites return HTTP 200, $false otherwise.

EXAMPLE 2

$config = Get-SqlDscRSConfiguration -InstanceName 'SSRS'
Test-SqlDscRSAccessible -Configuration $config -Site 'ReportServerWebService'

Tests if only the ReportServerWebService site is accessible for the SSRS instance.

EXAMPLE 3

Test-SqlDscRSAccessible -ReportServerUri 'http://localhost/ReportServer' -ReportsUri 'http://localhost/Reports'

Tests if the specified ReportServer and Reports URIs are accessible using explicit URIs.

EXAMPLE 4

Get-SqlDscRSConfiguration -InstanceName 'SSRS' | Test-SqlDscRSAccessible -Detailed

Tests if all configured sites are accessible and returns a detailed object with status information for each site.

PARAMETERS

-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.

Type: Object
Parameter Sets: Configuration
Aliases:

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

-Detailed

When specified, returns a detailed object containing accessibility status, HTTP status codes, and URIs for each site instead of a simple boolean.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-ReportServerUri

Specifies the explicit URI for the ReportServer web service to test. This parameter is used in the Uri parameter set.

Type: String
Parameter Sets: Uri
Aliases:

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

-ReportsUri

Specifies the explicit URI for the Reports web portal to test. This parameter is used in the Uri parameter set.

Type: String
Parameter Sets: Uri
Aliases:

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

-RetryIntervalSeconds

Specifies the interval in seconds between retry attempts. Defaults to 5 seconds.

Type: Int32
Parameter Sets: (All)
Aliases:

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

-ServerName

Specifies the server name to use when constructing URLs from the configuration. Defaults to $env:COMPUTERNAME.

Type: String
Parameter Sets: Configuration
Aliases:

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

-TimeoutSeconds

Specifies the maximum time in seconds to wait for the sites to become accessible. Defaults to 120 seconds.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: 120
Accept pipeline input: False
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

Microsoft.Management.Infrastructure.CimInstance

Accepts MSReportServer_ConfigurationSetting CIM instance via pipeline.

OUTPUTS

System.Boolean

Returns $true if all specified sites return HTTP 200, $false otherwise.

System.Management.Automation.PSCustomObject[]

When -Detailed is specified, returns an array of objects, one for

each site tested, containing:

- Site: The site name (e.g., 'ReportServerWebService', 'ReportServerWebApp').

- Accessible: Boolean indicating if the site is accessible.

- StatusCode: HTTP status code returned from the site.

- Uri: The URI that was tested.

NOTES

This command uses Invoke-WebRequest with -UseDefaultCredentials to authenticate to the Reporting Services sites.

RELATED LINKS

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