Friday, May 25, 2007

Enable IIS 6.0 Extensions using VBScript

If you've worked with IIS 5 and IIS 6, you know that IIS 6 has some tighter default security settings. For example, an administrator must take explicit steps to enable the server execution of ASP/ASP.NET applications. This is accomplished with a few quick clicks, but I'm always looking for shortcuts, e.g.

    Set IIsWebServiceObj = GetObject("IIS://localhost/W3SVC")IIsWebServiceObj.EnableWebServiceExtension "ASP.NET v1.1.4322" IIsWebServiceObj.SetInfo
Taking it a step further, suppose you have a proprietary extension, for instance a dll or exe which serves as an engine to render dynamic html. In other words, say you have a very OLD application. Here's how you would handle that wrinkle:

    Option explicit
    dim IIsWebServiceObj

    Set IIsWebServiceObj = GetObject("IIS://localhost/W3SVC")

    'Enable Proprietary Extention
    IISWebServiceObj.AddExtensionFile "c:\mydll.dll", true, "MyDLL", true, _ "MyProprietaryExtensions"
    IIsWebServiceObj.SetInfo

    wscript.echo "success!"

1 comment:

  1. Hello I want to congratulate to them by its site of the Web of the excellent looks like entertained and very good very to me it elaborated.

    ReplyDelete