Passing credentials through to exec command
Posted on 2005-05-03
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.