Jump to content

Powershell exec IN PHP ????


nitbabar

Recommended Posts

have a executable binary to which i pass some dynamic values as hostname,host id,server name,server id and a text field value.

 

Now i call this binary using exec or shell_exec functions in PHP to stimulate Command executions as a admin.

 

But i am able to invoke the binary and not able to use psexec service of windows.

 

I get logs and DB entries successfully but i also have a xml push operation in psexec call that is required.

 

the format is like ::

 

exec($url,$output,$return_var);

 

url is the command path with parameters .

output is an out param and return is the code on execution

 

this is executed in PHP and i want this binary to generate the same output as done from CLI .

 

Currently i guess it's a permission issue with shell that disallows psexec call.

 

How do i invoke the binary with psexec access outside PHP on command shell

 

I have set access privilege of Powershell  to "unrestricted" so that any script can be executed.

 

Still it hangs up somewhere in th script causing problems in copying XML file.

 

Powershell psexec is required in the process and i need to track down the root cause so that php side scripting of binary is successfull.

 

Please let me know about your ideas in fixing this.

 

I am using google and trying examples ,but i havent got any feasible solution.

 

Hope some expert advice can guide me out of this.

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.