locked
Error while running script through web setup installer. RRS feed

  • Question

  • Hi,

    I am trying to run a script to  'add an application pool and to set its identity on iis 7.0.' through installer(web setup project ).But its giving error in script while installing it on windows server 2008 r2 64 bit .I have created installer through  visual studio 2005.

    Script I am using is as follows:

    Function CreateNewAppPool()
        dim AppPools, newAppPool,shell
        set shell = CreateObject("WScript.Shell")
        domain = shell.ExpandEnvironmentStrings("%USERDOMAIN%")
        msgbox(domain)
        msgbox(domain&"\"&myaccount)
        set AppPools = GetObject("IIS://localhost/w3svc/AppPools")
        msgbox("Creating app pool") 
        set newAppPool = AppPools.Create("IIsApplicationPool", "testpool")        // error is coming at this point

        msgbox("Set pool identity")
        newAppPool.WamUserName = domain&"\"&username
        newAppPool.WamUserPass = InputBox("Password")
        newAppPool.LogonMethod =1 
        newAppPool.AppPoolIdentityType=3
        newAppPool.SetInfo
        if err = 0 then
          CreateNewAppPool = True
           msgbox("App pool created")
        else
          CreateNewAppPool = false
          msgbox("Error")
       end if

    Tuesday, July 10, 2012 2:56 PM

Answers

All replies