locked
Running powershell by php recieves error RRS feed

  • Question

  • Hi.

    I have such problem: IIS with PHP, I'm trying to run powershell command to connect to the Virtual Machine Manager and recieve an error - "Access Denied". Trying to run "shell_exec('powershell get-credential')" to input login/password and recieve same error too.

    How can I run powershell by php script and get administrator rights in that powershell session?

     

    Host configuration:

    Win2k8 R2 x64

    AD, HyperV and IIS roles

    PHP v5.2.5 x64

    SCVMM 2008 R2 x64



    Thursday, April 28, 2011 11:07 AM

Answers

  • you want to change the app pool, not the IIS service... im not sure how this works out with PHP, or where it gets its security context from.. but, there are ways to write out the security context so  you might want to figure out how to do that in PHP to see who its running as... and go from there... you might be better off asking this question in an IIS forum...

    • Marked as answer by Alan Zhu Tuesday, May 3, 2011 2:36 AM
    Thursday, April 28, 2011 1:08 PM

All replies

  • I know with IIS/ASPX that the application pool identity is used so unless you change it, it’s the computer account.. the last time I played with that I had to change the app pool account to a user account..

    Thursday, April 28, 2011 12:28 PM
  • I've already created new account with administrator privileges, but when I make it as logon account of IIS service (World Wide Web Publishing Service) it's not starting.
    Thursday, April 28, 2011 12:44 PM
  • you want to change the app pool, not the IIS service... im not sure how this works out with PHP, or where it gets its security context from.. but, there are ways to write out the security context so  you might want to figure out how to do that in PHP to see who its running as... and go from there... you might be better off asking this question in an IIS forum...

    • Marked as answer by Alan Zhu Tuesday, May 3, 2011 2:36 AM
    Thursday, April 28, 2011 1:08 PM
  • Thanks, I'll try there
    Thursday, April 28, 2011 2:35 PM