Get‑SqlDscRSLogPath - dsccommunity/SqlServerDsc GitHub Wiki

SYNOPSIS

Gets the log file path for SQL Server Reporting Services or Power BI Report Server.

SYNTAX

ByInstanceName (Default)

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

ByConfiguration

Get-SqlDscRSLogPath -Configuration <Object> [<CommonParameters>]

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

EXAMPLES

EXAMPLE 1

Get-SqlDscRSLogPath -InstanceName 'SSRS'

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

EXAMPLE 2

Get-SqlDscRSLogPath -InstanceName 'PBIRS'

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

EXAMPLE 3

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

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

EXAMPLE 4

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

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

EXAMPLE 5

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

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: ByConfiguration
Aliases:

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

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

Type: String
Parameter Sets: ByInstanceName
Aliases:

Required: True
Position: Named
Default value: None
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.String

Returns the path to the log files folder for the specified Reporting

Services instance.

NOTES

RELATED LINKS

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