Set-IisWebsiteID

Sets a website's ID to an explicit number.

Syntax

Set-IisWebsiteID [-SiteName] <String> [-ID] <Int32> [-WhatIf] [-Confirm] [<CommonParameters>]

Description

IIS handles assigning websites individual IDs. This method will assign a website explicit ID you manage (e.g. to support session sharing in a web server farm).

If another site already exists with that ID, you'll get an error.

When you change a website's ID, IIS will stop the site, but not start the site after saving the ID change. This function waits until the site's ID is changed, and then will start the website.

Beginning with Carbon 2.0.1, this function is available only if IIS is installed.

Parameters

Name Type Description Required? Pipeline Input Default Value
SiteName String

The website name.

true false
ID Int32

The website's new ID.

true false 0
WhatIf SwitchParameter false false
Confirm SwitchParameter false false
CommonParameters This cmdlet supports common parameters. For more information type
Get-Help about_CommonParameters.

EXAMPLE 1

Set-IisWebsiteID -SiteName Holodeck -ID 483

Sets the Holodeck website's ID to 483.