Get‑SqlDscRSExecutionLog - dsccommunity/SqlServerDsc GitHub Wiki

SYNOPSIS

Gets execution log entries from the SQL Server Reporting Services or Power BI Report Server database.

SYNTAX

Get-SqlDscRSExecutionLog [-InstanceName] <String> [[-StartTime] <DateTime>] [[-EndTime] <DateTime>]
 [[-UserName] <String>] [[-ReportPath] <String>] [[-MaxRows] <Int32>] [[-Credential] <PSCredential>]
 [[-LoginType] <String>] [-Encrypt] [[-StatementTimeout] <Int32>] [-Force] 
 [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Gets execution log entries from the ExecutionLog3 view in the report server database for SQL Server Reporting Services (SSRS) or Power BI Report Server (PBIRS). This view provides detailed records of report executions, including users, execution times, parameters, and rendering data.

The command automatically retrieves the database connection information (server name and database name) from the Reporting Services configuration CIM instance.

The ExecutionLog3 view is available in SQL Server 2016 and later versions.

EXAMPLES

EXAMPLE 1

Get-SqlDscRSExecutionLog -InstanceName 'SSRS' -Force

Returns the last 1000 execution log entries from the SSRS report server database.

EXAMPLE 2

Get-SqlDscRSExecutionLog -InstanceName 'PBIRS' -MaxRows 100 -Force

Returns the last 100 execution log entries from the Power BI Report Server database.

EXAMPLE 3

Get-SqlDscRSExecutionLog -InstanceName 'SSRS' -StartTime (Get-Date).AddDays(-7) -Force

Returns execution log entries from the last 7 days.

EXAMPLE 4

Get-SqlDscRSExecutionLog -InstanceName 'SSRS' -UserName 'DOMAIN\%' -Force

Returns execution log entries for all users in the DOMAIN domain.

EXAMPLE 5

Get-SqlDscRSExecutionLog -InstanceName 'SSRS' -ReportPath '/Sales/%' -MaxRows 500 -Force

Returns up to 500 execution log entries for reports in the /Sales/ folder.

EXAMPLE 6

$cred = Get-Credential
Get-SqlDscRSExecutionLog -InstanceName 'SSRS' -Credential $cred -LoginType 'SqlLogin' -Force

Returns execution log entries using SQL Server authentication.

PARAMETERS

-Credential

Specifies the credentials to use to impersonate a user when connecting to the report server database. If not provided, the current user's Windows credentials will be used.

Type: PSCredential
Parameter Sets: (All)
Aliases:

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

-Encrypt

Specifies whether encryption should be used for the database connection.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-EndTime

Specifies the end time to filter execution log entries. Only entries with a TimeStart less than or equal to this value will be returned.

Type: DateTime
Parameter Sets: (All)
Aliases:

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

-Force

Specifies that the query should be executed without any confirmation.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
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 is a mandatory parameter.

Type: String
Parameter Sets: (All)
Aliases:

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

-LoginType

Specifies which type of credentials are specified. The valid types are Integrated, WindowsUser, and SqlLogin. If WindowsUser or SqlLogin are specified then the Credential needs to be specified as well. Defaults to 'Integrated'.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 8
Default value: Integrated
Accept pipeline input: False
Accept wildcard characters: False

-MaxRows

Specifies the maximum number of rows to return. Defaults to 1000. Set to 0 to return all rows (use with caution on large databases).

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Default value: 1000
Accept pipeline input: False
Accept wildcard characters: False

-ReportPath

Specifies the report path to filter execution log entries. Supports SQL LIKE pattern matching (e.g., '/Sales/%' or '%Revenue%').

Type: String
Parameter Sets: (All)
Aliases:

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

-StartTime

Specifies the start time to filter execution log entries. Only entries with a TimeStart greater than or equal to this value will be returned.

Type: DateTime
Parameter Sets: (All)
Aliases:

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

-StatementTimeout

Specifies the query statement timeout in seconds. Default is 600 seconds (10 minutes).

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 9
Default value: 600
Accept pipeline input: False
Accept wildcard characters: False

-UserName

Specifies the user name to filter execution log entries. Supports SQL LIKE pattern matching (e.g., 'DOMAIN%' or '%admin%').

Type: String
Parameter Sets: (All)
Aliases:

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
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

None.

OUTPUTS

System.Data.DataRow

Returns DataRow objects containing execution log entries with columns

such as InstanceName, ItemPath, UserName, ExecutionId, RequestType,

Format, Parameters, ItemAction, TimeStart, TimeEnd, TimeDataRetrieval,

TimeProcessing, TimeRendering, Source, Status, ByteCount, RowCount,

and AdditionalInfo.

NOTES

RELATED LINKS

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