Link to home
Start Free TrialLog in
Avatar of fentoozler
fentoozler

asked on

Passing credentials through to exec command

How can I pass user credentials (using integrated Windows authentication with IIS) through to a command which is being executed via exec()?  I am trying to write a simple web-based script which will sync files from our development server to production using robocopy.  The problem is that when I execute robocopy through exec(), it runs under the IIS user who doesn't have permissions to the production share.

I want the robocopy command to be executed under the credentials of whoever is logged in.  I have tried using runas and CPAU but neither worked (runas doesn't allow passwords to be passed in, and CPAU opens the command in another window so no output back to the php script).  Also, I do not want to modify permissions, or create any new users to accomplish.  The users who are logging in having the necessary permissions.

I appreciate any help.
Avatar of fentoozler
fentoozler

ASKER

Nobody?
I don't think that's possible with how IIS does things.  You'll probably need to find another solution.  Does this absolutely have to work inside of PHP?
I would like it to work in PHP, but any other language would be acceptible as long as it stays web-based.
ASKER CERTIFIED SOLUTION
Avatar of dougday
dougday

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial