Restart‑SqlDscRSService - dsccommunity/SqlServerDsc GitHub Wiki

SYNOPSIS

Restarts a SQL Server Reporting Services instance.

SYNTAX

ByServiceName (Default)

Restart-SqlDscRSService -ServiceName <String> [-WaitTime <UInt16>] [-Force]
 [-WhatIf] [-Confirm] [<CommonParameters>]

ByConfiguration

Restart-SqlDscRSService -Configuration <Object> [-WaitTime <UInt16>] [-PassThru] [-Force]
 [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Restarts a SQL Server Reporting Services or Power BI Report Server Windows service. This command stops the service, optionally waits for a specified time, then starts the service again. It also restarts any dependent services that were running before the restart.

The command can be used in two ways:

  • With a configuration CIM instance from Get-SqlDscRSConfiguration
  • With a service name directly

EXAMPLES

EXAMPLE 1

Get-SqlDscRSConfiguration -InstanceName 'SSRS' | Restart-SqlDscRSService

Restarts the Reporting Services instance 'SSRS'.

EXAMPLE 2

Restart-SqlDscRSService -ServiceName 'SQLServerReportingServices'

Restarts the Reporting Services service by name.

EXAMPLE 3

Get-SqlDscRSConfiguration -InstanceName 'SSRS' | Restart-SqlDscRSService -WaitTime 30

Restarts the Reporting Services instance and waits 30 seconds between stopping and starting the service.

EXAMPLE 4

Restart-SqlDscRSService -ServiceName 'SQLServerReportingServices' -Force

Restarts the service without confirmation.

EXAMPLE 5

Get-SqlDscRSConfiguration -InstanceName 'SSRS' | Restart-SqlDscRSService -PassThru

Restarts the service and returns the configuration CIM instance.

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

-Force

If specified, suppresses the confirmation prompt.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-PassThru

If specified, returns the configuration CIM instance after restarting the service. Only applicable when using the Configuration parameter.

Type: SwitchParameter
Parameter Sets: ByConfiguration
Aliases:

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

-ServiceName

Specifies the name of the Reporting Services Windows service to restart. This parameter is used when the service name is known and a configuration object is not available.

Type: String
Parameter Sets: ByServiceName
Aliases:

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

-WaitTime

Specifies the number of seconds to wait after stopping the service before starting it again. This can be useful to allow the service to fully release resources before restarting. Default value is 0 seconds.

Type: UInt16
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: 0
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

Microsoft.Management.Infrastructure.CimInstance

Accepts MSReportServer_ConfigurationSetting CIM instance via pipeline.

OUTPUTS

None. By default, this command does not generate any output.

Microsoft.Management.Infrastructure.CimInstance

When PassThru is specified and using Configuration parameter, returns

the MSReportServer_ConfigurationSetting CIM instance.

NOTES

Dependent services that were running before the restart will be automatically restarted after the main service starts.

RELATED LINKS

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/restart-service

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