You'll love Web Connection 3.10. It has support for installing multiple Web sites and remote Web sites with Config Server. There's also a new class that pops up a form and lets you pick the domain and Web Site and it returns an ADSI path to that site.
>oWebService = GetObject( "IIS://LocalHost/W3SVC")
The path is:
IIS://localhost/W3SVC/1/ROOT
IIS://localhost/W3SVC/2/ROOT
IIS://localhost/W3SVC/3/ROOT
THe numbers are the ADSI Web site IDs. They may not be sequential if you delete a site for example.
+++ Rick ---
>>>After doing a fair amount of research, I still have some questions of ADSI:
>>>
>>>How do I set the name of the server?
>>>How do I set the home directory?
>>>How do I add a default doc to the list?
>>>
>>>CopyHere is excellent. I wish I had known about this before I would have saved myself a lot of time.
>>>
>>>TIA
>>
>>Look at the documentation for wwWebServer and wwIISAdmin, which lets you do what you want. You'd have to pick your Web site first then call the various other functions with the ADSI path set to this Web site.
>>
>>Easy as pie...
>
>
>Ok here's what I have so far. I'm so close.
>
>oWebService = GetObject( "IIS://LocalHost/W3SVC" )
>
>* I'd like to be able to name the server, but apparently you have to give it
>* the next available number. That still possible I could use GetObject until
>* I received an error incrementing by 1 and that would be my new server.
>oWebServer = oWebService.Create( "IIsWebServer", "13" )
>
>* If you call the virtual directory root. It attaches itself to the server you
>* just created ( at least as far as the Management Console is concerned ).
>oVirtualDir = oWebServer.Create( "IIsWebVirtualDir", "Root" )
>
>oVirtualDir.Path = "D:\INetPub\WWWRoot\WConnect\"
>oVirtual.AccessExecute = .T.
>oVirtual.AccessRead = .T.
>
>lcDefaultDocs = oVirtual.DefaultDoc
>IF NOT EMPTY( lcDefaultDocs )
> lcDefaultDocs = "Index.Htm, " + lcDefaultDocs
>ENDIF
>oVirtual.DefaultDoc = lcDefaultDocs
>
>Great. Now how do I set the name of the web site? There has to be a way.