Archive for the ‘IIS’ Category

Changing the identifier of a website in IIS

22 June, 2007

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.