We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

GetObject("IIS://LocalHost/W3SVC/1/ROOT") fails on IIS 7RSS

5 replies

Last post Sep 05, 2006 01:49 PM by dhacker

  • GetObject("IIS://LocalHost/W3SVC/1/ROOT") fails on IIS 7

    Aug 30, 2006 05:43 PM|JeromeC|LINK

    Hello,

    In IIS 6 I could create virtual directories using the following:

     

    On Error Resume Next

    Set iRoot = GetObject("IIS://LocalHost/W3SVC/1/ROOT")

    if (Err.Number <> 0) then

          MsgBox "Web Server doesn't exist"

          wscript.Quit

    end if

     

    Set MyVirDir = iRoot.Create("IIsWebVirtualDir", "VirDir")

     

     The call to GetObject("IIS://LocalHost/W3SVC/1/ROOT") fails on IIS 7

    Can you please shed some light on this failure?

  • Re: GetObject("IIS://LocalHost/W3SVC/1/ROOT") fails on IIS 7

    Aug 31, 2006 08:40 PM|rayner|LINK

    Hi Jerome,

    What error do you get when you say it fails on IIS7? You may also need to install the IIS-Metabase package to use the ADSI and the ABO(Metabase) Compat layers.

    Thanks, Rayner.

    Rayner D'Souza
    Software Design Engineer
    IIS Team
    Microsoft Corporation
  • Re: GetObject("IIS://LocalHost/W3SVC/1/ROOT") fails on IIS 7

    Sep 01, 2006 12:45 PM|JeromeC|LINK

    Hello Rayner,

    I apologize for being vague - My call to GetObject("IIS://LocalHost/W3SVC/1/ROOT") returns a non-zero value. I suspect that the path has changed in IIS 7 – is IIS://LocalHost/W3SVC/1/ROOT valid in IIS 7. If no, can you provide the correct value?

    Thank you for your support!

    JeromeC

  • Re: GetObject("IIS://LocalHost/W3SVC/1/ROOT") fails on IIS 7

    Sep 01, 2006 01:08 PM|rayner|LINK

    Hi Jerome,

    set xyz = GetObject("IIS://localhost/w3svc/1/root") is still valid in IIS7. It may not work if either the scripting (ADSI) or AdminBaseObject support modules are not installed on the machine. The non-zero value returned may help me diagnose what may be amiss.

    Thanks, Rayner

    Rayner D'Souza
    Software Design Engineer
    IIS Team
    Microsoft Corporation
  • Re: GetObject("IIS://LocalHost/W3SVC/1/ROOT") fails on IIS 7

    Sep 05, 2006 12:03 PM|JeromeC|LINK

    Hello Rayner,

     

    I was able to resolve the behavior using your suggestion of enabling the IIS Metabase and IIS6 configuration compatibility option located in the OptionalFeature view of Vista.

     

    (For the record the return code of the call was -2147221020)

     

    Thank you again for your assistance in this matter.

    Best Regards,

    JeromeC

  • Re: GetObject("IIS://LocalHost/W3SVC/1/ROOT") fails on IIS 7

    Sep 05, 2006 01:49 PM|dhacker|LINK

    If configuring IIS 7 using legacy scripts, you might be interested in this article:

    http://www.iis.net/default.aspx?tabid=2&subtabid=25&i=943

    It explains that the 'Metabase Compatibility component of IIS 7.0' must be installed and is not installed by default.