Jump to content

Using exec


dlynas

Recommended Posts

I am trying to run part of the pstools kit on a webpage - It is a web-based computer management system, so for it lists all computers in a OU and their MAC address and their is the ability to WOL them, i want to run psloggedon which returns who is logged onto the machine from a php page but do not know how to do with a return the result, psloggedon take the computername as a parameter. Can anyone help me please?

Link to comment
Share on other sites

its runs without any errors but doesnt return anythign to the screen

 

Alot of shell apps do so when there are errors. What do you get when you type that exact command at the term, and can we see the exact command you used.

Link to comment
Share on other sites

the command is

 

psloggededon \\computername

 

 

It returns

 

N:\Tools\TNT\geeky\PsTools>psloggedon \\rowlands

 

PsLoggedOn v1.31 - Logon Session Displayer

Copyright © 1999-2003 Mark Russinovich

Sysinternals - www.sysinternals.com

 

Users logged on locally:

    <Unknown> NT AUTHORITY\LOCAL SERVICE

    <Unknown> NT AUTHORITY\NETWORK SERVICE

    <Unknown> HELESSCHOOL\ROWLANDS

    <Unknown> NT AUTHORITY\SYSTEM

 

Users logged on via resource shares:

    23/07/2007 15:08:53    LYNAS\LYNAS

 

 

 

When run from command prompt - i have point the script to the correct location of the psloggedon exe

Link to comment
Share on other sites

When run from command prompt - i have point the script to the correct location of the psloggedon exe

 

Then you need to do that here aswell.

 

<?php

  function psloggedon($pcname) {
    return shell_exec("N:\Tools\TNT\geeky\PsTools\psloggedon \\\\$pcname");
  }

  echo psloggedon('foo');

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.