Re: Using COM
| From: | (David Broker) | Date: | Sun, 30 Sep 2001 23:28:13 +0000 |
| Subject: | Re: Using COM | ||
| References: | 1 2 3 4 5 6 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-9628@lists.php.net to get a copy of this message | ||
In article <20010930212220.56247.qmail@pb1.pair.com>,
crawley.storm@ntlworld.com (Crawley) wrote:
>
>"David Broker" <php@warpedweb.net> wrote in message
>news:20010929012745.1977.qmail@pb1.pair.com...
>> Rich,
>> Microsoft claims (in the IIS help) that this is an object which you can
>access
>> with any language which supports COM.
>>
>> In the VBscript found on any Win2K server it is called like this:
>> varname = GetObject("IIS://localhost/w3scv")
>>
>> So I'm assuming that IIS://localhost/w3scv is an object.
>>
>> My problem was that I could not access that object, as that format (the
>> "IIS://")is not supported in the non-dev releases.
>>
>> I will (probably) be running it on a local machine so I shouldn't have a
>> problem there.
>>
>> Regards,
>> David
>
>Right mate, Ive had a quick search on Google and found this....
>
>Under Foxpro - you access it like
>loIIS=CREATE("wwIISAdmin.IIS4Config")
>IF loIIS.ConnectPath("IIS://LOCALHOST/W3SVC/1/ROOT")
> ? loIIS.GetValue("AuthBasicIsolated")
> ? loIIS.GetValue("DefaultDoc")
>
> ? loIIS.m_oIISObj.Stop()
> * ? loIIS.m_oIISObj.Start()
>ELSE
>wait window "Unable to retrieve path..."
>ENDIF
>
>So I would suspect that the interface is "wwIISAdmin.IIS4Config" or
>something like that. Thus if Im correct you would need something like
>
><?php
>
>$IIS_Admin = COM( "wwIISADmin.IIS4Config" );
>if( $IIS_Admin->ConnectPath( "IIS://Localhost/W3SVC/1/ROOT" ) )
>{
>.....
>
>you get the idea.
>
>Hope that helps.
>
>Rich
Rich,
$iis = COM(IIS://localhost/w3svc/1");
echo $iis->status;
worked fine and printed out "Running".
Ofcourse it will only work when run from the commandline when logged on a
Administrator, as the webserver doesn't have permission to read/write the IIS
meta-database, which kindof kills my idea for a quick-and-easy setup of a
large number virtual hosts where the setup is all the same.
However $iis->stop does not work. It seems even from the command line I cannot
write to the meta-database.
Regards,
David