SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: PSExec

  1. #1
    SitePoint Member
    Join Date
    Sep 2003
    Location
    Australia
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb Sys Admin Software (was PSExec)

    Has anyone run this using exec() in a php page ?
    On a WinXP Pro box, IIS, PHP 4.3.1.1

    I can run this on the command line:
    C:\inetpub\wwwroot\psexec.exe \\PCname -u domain\administrator -p password -i -d NOTEPAD
    and it works fine (PC & user details changed).

    but if I run this from inside a php page:
    if ($submit) {
    $file = "psexec.exe \\\\PCname -u domain\\" . $username . " -p " . $password . " " . $interactive . " -d " . $program;
    $str = exec($file);

    } else {}
    ?>
    It produces nothing. The variables do contain the correct info. The permission on the file is for eveyone 'full access'. Any ideas ?

    I CAN run another .exe from the wwwroot directory, using this code from a php page:
    $file = "wol.exe " . $NicMACAddress;
    $str=exec($file);

    Onion...
    Last edited by Onion; Sep 9, 2003 at 18:46.

  2. #2
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Well, you may have played with php.ini but by default, with PHP 4.3.1 you should be using the super-global arrays to access form data.
    PHP Code:
    if ( isset($_POST['submit']) ) { 
    but if you have changed register_globals to On, try printing out the form variables to see what they contain. Also, if you have magic_quotes on that may have an effect as well.

  3. #3
    SitePoint Member
    Join Date
    Sep 2003
    Location
    Australia
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After I reset permissions - had to reboot. Seems fine now...

    If anyone is interested, I have nearly finished my System Management software. Works as follows:
    Windows clients only.
    Server running IIS, PHP & MySQL.
    Clients need VNC installed (for remote control).

    Windows clients log on to the domain and run a login script. This script captures quite a lot of information about the client, and sends it to the MySQL database.

    Using an authenticated web browser, administrators can see client inventories and perform actions on PCs.

    If the clients are Win9x, inventories can be taken, PCs can be started (WOL), remote control can be initiated.

    If the clients are WinNT (2k,WP) based, the above can happen, as well as programs can be run remotely on the clients, clients can be shutdown, rebooted, inventory taken immediately. I am working on file transfer at the moment (to individual clients, or groups).

    If anyone is interested drop me a line at munwin99 at hotmail. (Will have to setup a sourceforge page one of these days).
    Last edited by Onion; Sep 9, 2003 at 18:47.

  4. #4
    SitePoint Member
    Join Date
    Dec 2004
    Location
    Quebec
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it possible to have your php source file ?

    I have the same problem whit psexec

    thanks

  5. #5
    SitePoint Member
    Join Date
    Sep 2003
    Location
    Australia
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Go to winventory.sf.net and download one of the older versions - 0.4 I think. This has the page you want. It's called actions.php, and it's sub pages.

    Onion.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •