Stop‑SqlDscRSWindowsService - dsccommunity/SqlServerDsc GitHub Wiki

SYNOPSIS

Stops the Reporting Services Windows service.

SYNTAX

Stop-SqlDscRSWindowsService [-Configuration] <Object> [-Force] [-WhatIf]
 [-Confirm] [<CommonParameters>]

DESCRIPTION

Stops the SQL Server Reporting Services or Power BI Report Server Windows service by calling the SetServiceState WMI method with EnableWindowsService set to $false.

This command preserves the current state of the web service. If the Windows service is already disabled, the command proceeds without error (idempotent behavior).

The configuration CIM instance can be obtained using the Get-SqlDscRSConfiguration command and passed via the pipeline.

EXAMPLES

EXAMPLE 1

Get-SqlDscRSConfiguration -InstanceName 'SSRS' | Stop-SqlDscRSWindowsService

Stops the Windows service for the SSRS instance by piping the configuration from Get-SqlDscRSConfiguration.

EXAMPLE 2

$config = Get-SqlDscRSConfiguration -InstanceName 'SSRS'
Stop-SqlDscRSWindowsService -Configuration $config -Force

Stops the Windows service for the SSRS instance without confirmation.

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: (All)
Aliases:

Required: True
Position: 1
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

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

NOTES

RELATED LINKS

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