Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 0 down vote accepted

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.