Sets a website's ID to an explicit number.


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


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.


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.


Set-IisWebsiteID -SiteName Holodeck -ID 483

Sets the Holodeck website's ID to 483.