Our website has a large number of virtual directories being used as redirects (aprox. 150+). We're in the process of making a dev site that will ultimately become our live site so those directories need to be copied over to the new site. I have seen scripts to create virtual directories, but I don't see a way to set them as redirects. Is there a way to move these directories and what they redirect to with a script, or within IIS itself?

1 Answer 1


The IIS 6 metabase is stored in an XML format, so you may be able to get away with slicing and dicing the XML files on the source and destination servers to get what you want.

Failing that, you could write a script using adsutil.vbs to enumerate all the directories on the source server and create them on the destination server. Setting a directory to do HTTP redirection involves setting the "HttpRedirect" metabase property with the destination URL and the appropriate flag (see http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/b652c863-6334-40be-8a97-db4b368f3ecc.mspx?mfr=true).

  • Thanks Evan. I know about the metabase, but I haven't heard much about playing with it other than a few horror stories. I'll take a look at that and the link.
    – CoreyT
    Apr 4, 2011 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.