views:

133

answers:

1

I would like to automate the following task with a script to create an IIS script mappings for my project:

  • Go to Control Panel | Administrative Tools
  • Open Internet Information Services
  • Right-click the Default web site and select Properties.
  • In the Properties dialog-box select the 'home Directory' tab.
  • Click on the configuration button in the Application Configuration dialog.
  • Click on the 'Add' button.

In the Add/Edit dialog-box, ensure the following settings are correct:

  • for executable, put in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
  • for the extension, put in '*'
  • for Verbs, select 'All verbs'
  • select 'Script Engine' and leave 'Check that file exists' blank.

Note: The IIS v5.1 Manager console allows you to add '*' wild card extension names but IIS v6 manager does not. It is just a UI limitation. My box is WinXP.

A: 

Heya Brig.

We have a script that does some updating to IIS, using javascript.

var iisPath = "IIS://localhost/W3SVC/" + siteID;
var site = GetObject(iisPath);

From here you should be able to do what you want. You may need to look around the object model.

You may also want to check out the article at : http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO_Enumerate_IIS_Website_Configuration.aspx and here is the specific info for the ScriptMaps property: http://msdn.microsoft.com/en-us/library/ms526052.aspx

Jeff Martin