RE: start an external program (isqlw.exe)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To put this in some context.  This is only for an Intranet, no real security issues.  Only people within our intranet, will be able to use this service.  Just wanted a faster way to access all of our SQL Servers.


--
Gerardo S. Rojas
mailto: grojas@xxxxxxxxxxxxxxxx


-----Original Message-----
From: Sven Schnitzke [mailto:Sven.Schnitzke@xxxxxxxxxxx]
Sent: Monday, March 08, 2004 8:36 AM
To: ''
Subject: AW:  start an external program (isqlw.exe)


Ok, I got it.

> A next step in the thinking process Rojas is describing (see original
> question at the bottom!!) from my side would be to look out for
> possibilities to start the programm "isqlw.exe" in a COM context. After all,
> it's window$ so it should support (D)COM.

To clarify:

Lets say the machine running the PHP script in question is _web server_
and the machine the web request is issued from is _web client_.

You are then right to say that this _web client_ can be set up as a
_DCOM server_ to e.g. launch and execute the questioned program (isqlw.exe),
and to the extent it supports DCOM the program can even be passed
commands and parms (or in DCOM speak: one can set/get properties and 
execute methods of the _DCOM server_ object residing on the same
machine as the _web client_).

The former _web server_ for that matter behaves as _DCOM client_,
and is asked to do so by a web request issued by the _web client_.
The _web server_ in turn has to be able to issue DCOM requests and
understand the answers; either by itself (via PHP COM support) or via
any external program PHP may launch on the respective machine.

So Gerardo Rojas question falls into three parts:
a) is control over clients good enough to assume DCOM and isql.exe is installed
    correctly on the daily work basis and is this setup secure ? (administrative, off topic here, 
    but very essential)

b) is isqlw.exe COM aware and to what extent ? (off topic here, but preliminary to c)

c) does PHP COM support the necessary calls to get isqlw.exe to do
    the intended steps ? (That depends on the answer to b) because PHP COM does 
    not completely cover DCOM).

To clarify c) it might be helpful to create a VB script (e.g. using M$ documentation and Excel VBA) 
that does the trick locally, then setting up DCOM on DCOM client (web server) and DCOM server 
(web client) and migrate the VB script to PHP.

HTH
-- 
Sven

> -----Ursprüngliche Nachricht-----
> Von:	Winnesoup [SMTP:winnesoup@xxxxxxxxxx]
> Gesendet am:	Montag, 8. März 2004 00:08
> An:	Sven.Schnitzke@xxxxxxxxxxx; ''
> Betreff:	Re:  start an external program (isqlw.exe)
> 
> Hello Sven,
> 
> The word "certain" may be misplaced in this context due to my English.
> I have nothing in mind a responsible programmer wouldn't have in mind!
> 
> A next step in the thinking process Rojas is describing (see original
> question at the bottom!!) from my side would be to look out for
> possibilities to start the programm "isqlw.exe" in a COM context. After all,
> it's window$ so it should support (D)COM.
> 
> And there are more ways to do a server-side initiated programm execution.
> 
> But I must admit that the whole thinggie could end up in a "security-hell"
> or could people give the wrong ideas. In this matter I agree with Frank. So
> my addition to this thread ends.
> 
> regards,
> 
> Winnesoup
> ----- Original Message ----- 
> From: "Sven Schnitzke" <Sven.Schnitzke@xxxxxxxxxxx>
> To: "''" <php-windows@xxxxxxxxxxxxx>
> Sent: Sunday, March 07, 2004 10:54 PM
> Subject: AW:  start an external program (isqlw.exe)
> 
> 
> Hi,
> 
> > You can start certain programms at the client side using COM. But
> > (unfortunately ?) only when using PHP on windows webservers. Programm
> should
> > be installed at client side off course....
> 
> ... certain programs ... what do you have in mind ?
> -- 
> Sven
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Winnesoup [SMTP:winnesoup@xxxxxxxxxx]
> > Gesendet am: Samstag, 6. März 2004 11:19
> > An: php-windows@xxxxxxxxxxxxx
> > Betreff: Fw:  start an external program (isqlw.exe)
> >
> > You can start certain programms at the client side using COM. But
> > (unfortunately ?) only when using PHP on windows webservers. Programm
> should
> > be installed at client side off course. But I do agree with Frank.
> > ----- Original Message ----- 
> > From: "Frank M. Kromann" <frank@xxxxxxxxxxxx>
> > To: "Gerardo Rojas" <grojas@xxxxxxxxxxxxxxxx>
> > Cc: "Gerardo Rojas" <grojas@xxxxxxxxxxxxxxxx>; "Svensson, B.A.T. (HKG)"
> > <b.a.t.svensson@xxxxxxx>; <php-windows@xxxxxxxxxxxxx>
> > Sent: Wednesday, March 03, 2004 7:24 PM
> > Subject: RE:  start an external program (isqlw.exe)
> >
> >
> > > The answer is no (unless the client and server is running on the same
> > > bos).
> > >
> > > PHP is a server side scripting language and the only information send to
> > > the client is through the HTTP protocol. Cold you imaginne what would
> > > happen if a web server could start programs on the client maschine?
> > >
> > > - Frank
> > >
> > > > Got this to work, but my problem now is that this will only open
> windows
> > > on the machine hosting the WebServer, is there a way to open an
> > > application on the client side?
> > > >
> > > > also had to make some changes to IIS.  Logon Tab, check the box where
> it
> > > says "allow service to interact with desktop"
> > > >
> > > > my code goes here
> > > > -----------------------------------------------
> > > > $ip = $_SERVER['QUERY_STRING'];
> > > >
> > > > $program = "start \"Query Analyzer\" /D\"c:\\Program Files\\Microsoft
> > > SQL Server\\80\\Tools\\binn\" /NORMAL isqlw.exe -S$ip -Umyuserid
> > > -Pmypassword";
> > > > $aOutput = array();
> > > > $retval = 0;
> > > > echo "<br>program = $program";
> > > >
> > > > exec($program, $aOutput, $retval);
> > > > foreach($aOutput as $val )
> > > > {
> > > > echo "<br>value = $val";
> > > > }
> > > > echo "<br>Dumping retval = $retval";
> > > >
> > > > -------------------------------------------------
> > > >
> > > >
> > > > --
> > > > Gerardo S. Rojas
> > > > mailto: grojas@xxxxxxxxxxxxxxxx
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Gerardo Rojas [mailto:grojas@xxxxxxxxxxxxxxxx]
> > > > Sent: Tuesday, March 02, 2004 11:36 AM
> > > > To: Svensson, B.A.T. (HKG); php-windows@xxxxxxxxxxxxx
> > > > Subject: RE:  start an external program (isqlw.exe)
> > > >
> > > >
> > > > No, the "isqlw.exe" is the full SQL Query Analyzer tool.  I have the
> > > full path and executable name.  I just don't know how to call it
> (exactly)
> > > from within PHP.
> > > >
> > > >
> > > > --
> > > > Gerardo S. Rojas
> > > > mailto: grojas@xxxxxxxxxxxxxxxx
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Svensson, B.A.T. (HKG) [mailto:B.A.T.Svensson@xxxxxxx]
> > > > Sent: Tuesday, March 02, 2004 11:31 AM
> > > > To: php-windows@xxxxxxxxxxxxx
> > > > Subject: RE:  start an external program (isqlw.exe)
> > > >
> > > >
> > > > For system(), etc , you need executable right for the default command
> > > > shell, and you might like to do "start isql.exe ..." besides, you
> might
> > > > also need to include the full path(??).
> > > >
> > > > There are some other function calls that also might be better suited
> to
> > > > fork with... but let me have a check tomorrow (time to leave work)
> > > >
> > > > Anyhow, isqlw.exe, isn't that the plain windows version of isql.exe,
> > > > i.e. /not/ the analyzer but the simplified version of it?
> > > >
> > > > On Tue, 2004-03-02 at 18:25, Gerardo Rojas wrote:
> > > > > the executable is "isqlw.exe" the arguments are -S server -U
> userid -P
> > > password.
> > > > >
> > > > >
> > > > > --
> > > > > Gerardo S. Rojas
> > > > > mailto: grojas@xxxxxxxxxxxxxxxx
> > > > >
> > > > >
> > > > > -----Original Message-----
> > > > > From: Svensson, B.A.T. (HKG) [mailto:B.A.T.Svensson@xxxxxxx]
> > > > > Sent: Tuesday, March 02, 2004 11:23 AM
> > > > > To: php-windows@xxxxxxxxxxxxx
> > > > > Subject: RE:  start an external program (isqlw.exe)
> > > > >
> > > > >
> > > > > Aha, that makes sense! :)
> > > > >
> > > > > Very well, anyway.. .from time to time I tried to locate the
> > > executable
> > > > > for this, but failed (could not identify it in "$MSSQL_HOME\binn". I
> > > > > also been way to lazy with this (no urgent need as to say). Maybe to
> > > > > check the properties of start menu item will help(?), but am not so
> > > sure
> > > > > about that...
> > > > >
> > > > > In any case, if you find out, would you please save me some time as
> > > well
> > > > > and let me know?
> > > > >
> > > > > On Tue, 2004-03-02 at 18:17, Gerardo Rojas wrote:
> > > > > > I have many different SQL Servers that i connect to.  This way
> with
> > > PHP (webserver) i can generate a list and quickly pick the one I want
> and
> > > connect to it (also passing the userid and password, this seems like a
> > > faster way to do it)
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Gerardo S. Rojas
> > > > > > mailto: grojas@xxxxxxxxxxxxxxxx
> > > > > >
> > > > > >
> > > > > > -----Original Message-----
> > > > > > From: Svensson, B.A.T. (HKG) [mailto:B.A.T.Svensson@xxxxxxx]
> > > > > > Sent: Tuesday, March 02, 2004 11:14 AM
> > > > > > To: php-windows@xxxxxxxxxxxxx
> > > > > > Subject: Re:  start an external program (isqlw.exe)
> > > > > >
> > > > > >
> > > > > > Why the do you want to do this with php????
> > > > > >
> > > > > >
> > > > > > On Tue, 2004-03-02 at 17:29, Gerardo Rojas wrote:
> > > > > > > Is there a quick way to start the "Query Analyzer" from within
> > > PHP?
> > > > > > > I've tried exec() and system() with no success.
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Gerardo S. Rojas
> > > > > > > mailto: grojas@xxxxxxxxxxxxxxxx
> > > > > > >
> > > >
> > > > -- 
> > > > PHP Windows Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > > -- 
> > > > PHP Windows Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > > --
> > > > PHP Windows Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > >
> > > -- 
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> > -- 
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux