Re: Configure Virtual Directories on another server
am 25.10.2007 07:41:40 von David Wang
On Oct 24, 4:46 pm, "Chris M" wrote:
> I am always recreating my IIS virtual directories on to other servers. Is
> there an automated way I can recreate entire IIS virtual directory structure
> using export and import features of IIS? Any samples/articles would be
> great!
IIS version?
What you want can be done in a variety of ways:
1. Write script code against the IIS Admin APIs to create virtual
directory structure
2. Batch Script existing tools like ADSUTIL.VBS to create virtual
directory structure
3. On IIS6, use tools like IISCNFG.VBS to export/import virtual
directory structure.
http://technet2.microsoft.com/windowsserver/en/library/d7646 0b0-e6c3-4e95-88d1-064cdb2a048a1033.mspx?mfr=true
In all cases, you are responsible for making sure the physical
directories backing the virtual directories exist and are valid. IIS
will never guess and "fixup" your configuration mistakes.
IIS6 exposes import/export on the UI (same underlying code called by
IISCNFG.VBS). Script code/tools work on all modern IIS versions,
including IIS7 with IIS6 Metabase Compatibility component.
//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//
Re: Configure Virtual Directories on another server
am 31.10.2007 00:16:49 von Tiago Halm
Adding to David's response, here is a simple example for an existing VDir
using the import/export features of WMI for IIS6 in the same computer.
Remember that copying a VDir structure requires the same AppPool structure
(not covered in this example, but simple to figure out). The tools mentioned
by David are the full blown import/export out-of-the box tools that are
available to IIS6.
=======================
=== Export metadata
=======================
oIIS = new ManagementObject("\\root\\MicrosoftIISv2:IIsComputer=\"LM\"" );
oIIS.Get();
oIIS.InvokeMethod("Export", new object[] {
"",
"c:\\meta.txt",
"/LM/W3SVC/1/ROOT/Foo",
IIsWmiConstants.EXPORT_CHILDREN});
=======================
=== Import metadata
=======================
oIIS = new ManagementObject("\\root\\MicrosoftIISv2:IIsComputer=\"LM\"" );
oIIS.Get();
oIIS.InvokeMethod("Import", new object[] {
"",
"c:\\meta.txt",
"/LM/W3SVC/1/ROOT/Foo",
"/LM/W3SVC/1/ROOT/Foo",
IIsWmiConstants.IMPORT_CHILDREN});
More information on:
http://msdn2.microsoft.com/en-us/library/ms525669.aspx
Tiago Halm