Change Site ID in IIS 6

by Ted Jardine Monday, April 30, 2007 5:37 PM

We have an application that is dependant on a web site's Site ID in IIS. Usually, when we need to move a site from one server to the next, we just change the Site ID while using the handy IIS Migration Tool. However, we just had a site that was set up without the Site ID properly set so our database records were out of sync. A little bit of googling and presto:

  1. Open a command line (make sure you're an Admin or run the script as an Admin).
  2. Navigate to your AdminScripts directory (typically c:\Inetpub\AdminScripts).
  3. And run this script: cscript adsutil.vbs move w3svc/118431234 w3svc/11165089073 (where the first is the old Site ID and the second is the new one)

I'm displaying my ignorance I'm sure by posting this here as something I didn't know already, but heh, it's a useful thing to make note of (you didn't think I'd go do a search and replace in the IIS Metabase file did you?).

Tags: IIS 6.0

blog comments powered by Disqus

Month List