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
https://forums.phpfreaks.com/topic/222056-powershell-exec-in-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.