0

I'm having a problem with Apache HTTPD: I have a PHP application that executes the Windows command

shutdown -s -m \\<some machine> -t 0

It is used to shutdown unused servers in a network from a remote location.

The problem is, that I need to run that PHP app under a user account that also exists on the target machine and has the right privileges to execute the shutdown. I tried to run the Apache service that handles the PHP (php5_module) with an account that can execute the remote command (I tested it on the command line manually with that same account and it worked.) by setting User XYZ in httpd.conf but that didn't help.

The PHP script in question works perfectly if executed directly from the command line while logged in with the correctly privileged user account. If executed by the webserver, the called "shutdown" command responds with "Access denied".

Any suggestions?

1 Answer 1

0

The Problem is solved:

You can assign a specific user account to any windows service by right clicking it in the services list, going to the "Logon" tab and enter the user credentials there. The restart the service and it works.

Sometimes you just don't think of the simplest solutions ...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .