Changing the Website Identifier in IIS 6

In the daily dev environment that I use, there are a number of websites on a single IIS 6.0 installation and more are added regularly. Since I like to script as much as possible as well as do any tasks that I can from the command line, I like for my IIS website IDs to NOT be the normal, looong numeric value. Eg: 1234567890. It is much easier to read and type when those site IDs are small, sequential numbers.

Thankfully, the IDs are easily changed via command line. As small and simple as the command to change the ID is, I never remember it! I always have to look it up. So, I figured what better place to write myself a note than my own website.

To change a IIS Website ID, you will need the AdminScripts installed. By default, they are usually found in C:\inetpub\AdminScripts. So just open a command line and CD to C:\inetpub\adminscripts (or to wherever your Admin Scripts are found)

Now, to change the website ID of a site that currently has 1234567890 as the ID to an ID of 2, you would use the following command:

cscript adsutil.vbs move w3svc/1234567890 w3svc/2

That's it. Pretty simple huh?

Most Recent Photos