Set‑SqlDscRSUrlReservation - dsccommunity/SqlServerDsc GitHub Wiki

SYNOPSIS

Sets the URL reservations for a SQL Server Reporting Services or Power BI Report Server application to the specified list, or recreates all existing URL reservations.

SYNTAX

Set (Default)

Set-SqlDscRSUrlReservation -Configuration <Object> -Application <String> -UrlString <String[]> [-Lcid <Int32>]
 [-PassThru] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

Recreate

Set-SqlDscRSUrlReservation -Configuration <Object> [-Lcid <Int32>] [-PassThru] [-Force] [-RecreateExisting]
 [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

The Set-SqlDscRSUrlReservation command can operate in two modes:

Set Mode (default): Ensures that only the specified URL reservations exist for the given application. It removes any existing URL reservations that are not in the specified list and adds any URLs that are not currently reserved.

Recreate Mode: When using the -RecreateExisting parameter, the command removes and re-adds all existing URL reservations for all applications. This is useful after changing the Windows service account, as URL reservations are tied to a specific service account and must be recreated to use the new account.

This command uses the Get-SqlDscRSUrlReservation, Add-SqlDscRSUrlReservation, and Remove-SqlDscRSUrlReservation commands internally.

EXAMPLES

EXAMPLE 1

$config = Get-SqlDscRSConfiguration -InstanceName 'SSRS'
$config | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString 'http://+:80', 'https://+:443' -Force

Sets the URL reservations for the ReportServerWebService application to only 'http://+:80' and 'https://+:443'. Any other existing reservations for this application will be removed.

EXAMPLE 2

$config = Get-SqlDscRSConfiguration -InstanceName 'PBIRS'
$config | Set-SqlDscRSUrlReservation -Application 'ReportServerWebApp' -UrlString 'http://+:80' -Force -PassThru

Sets the URL reservations for the ReportServerWebApp application on a Power BI Report Server instance and returns the configuration object.

EXAMPLE 3

$config = Get-SqlDscRSConfiguration -InstanceName 'SSRS'
$config | Set-SqlDscRSUrlReservation -RecreateExisting -Force

Recreates all existing URL reservations for all applications. This is useful after changing the service account to update the reservations to use the new account.

PARAMETERS

-Application

Specifies the Reporting Services application for which to set URL reservations. Valid values are: ReportServerWebService, ReportServerWebApp, ReportManager. This parameter is only used in Set mode.

Type: String
Parameter Sets: Set
Aliases:

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

-Configuration

Specifies the Reporting Services configuration CIM instance. This is typically obtained by calling the Get-SqlDscRSConfiguration command.

Type: Object
Parameter Sets: (All)
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

-Lcid

Specifies the locale identifier (LCID) for the URL reservation. If not specified, the operating system language code is used. Note that the LCID used when creating a URL reservation is not stored or retrievable, so when using -RecreateExisting, the LCID cannot be determined from the existing reservations and defaults to the OS language.

Type: Int32
Parameter Sets: (All)
Aliases:

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

-PassThru

If specified, returns the Reporting Services configuration CIM instance.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-RecreateExisting

If specified, removes and re-adds all existing URL reservations for all applications. This is useful after changing the Windows service account, as URL reservations are tied to a specific service account and must be recreated to use the new account. This parameter cannot be used with -Application or -UrlString.

Type: SwitchParameter
Parameter Sets: Recreate
Aliases:

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

-UrlString

Specifies one or more URL strings to reserve. Any existing URL reservations for the application that are not in this list will be removed. This parameter is only used in Set mode.

Type: String[]
Parameter Sets: Set
Aliases:

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

Microsoft.Management.Infrastructure.CimInstance

Accepts a CIM instance for the Reporting Services configuration from the

pipeline.

OUTPUTS

None by default.

Microsoft.Management.Infrastructure.CimInstance

If -PassThru is specified, returns the Reporting Services configuration

CIM instance.

NOTES

This command calls the ReserveUrl and RemoveURL methods on the MSReportServer_ConfigurationSetting CIM class.

RELATED LINKS

Get-SqlDscRSUrlReservation

Add-SqlDscRSUrlReservation

Remove-SqlDscRSUrlReservation

https://docs.microsoft.com/en-us/sql/reporting-services/wmi-provider-library-reference/configurationsetting-method-reserveurl

https://docs.microsoft.com/en-us/sql/reporting-services/wmi-provider-library-reference/configurationsetting-method-removeurl

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