Changing the identifier of a website in IIS

Whilst writing build scripts for our BizTalk environment, I recently had to change the identifier of a website in IIS to match the values on several other servers. After a bit of digging around it turns out the command is quite simple.

One option is to use the very useful tool Metabase explorer in the IIS 6.0 resource kit. Be careful when changing the ID that you change any other properties that contain this id (such as AppRoot). I thoroughly recommend having a look at this download, as it contains a good few other very useful tools for developers.

Alternatively you can do this directly using the admin scripts. Make sure you stop the website or you’ll get errors in the event log. The command is:

cscript adsutil.vbs move w3svc/2 w3svc/3

Where 2 and 3 are the from and to ids respectively. adsutil.vbs can be found in \Inetpub\AdminScripts on your system drive.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: