Running a php script with a .bat file

后端 未结 6 1460
隐瞒了意图╮
隐瞒了意图╮ 2021-01-17 20:49

I need to run a php script at midnight every night on my server. On a linux system I\'d set up a cron job, but I\'m stuck with a windows system.

I know I have to set

6条回答
  •  [愿得一人]
    2021-01-17 21:12

    Sadly this took close to 10 hours to figure out. Some protocols such as WinRM and PSEXEC must pass the logged in user account regardless of the credentials supplied (that or PHP overrides whatever you type in). At any rate, to get PSEXEC, WinRM or just kicking off batch files that connect to remote computers, you will need to change the IIS run as account to a user with rights to those resources (service account). I realize this is a huge security hole, but that is by design. PHP is secure so that it can't be hacked easily, you have to override their security by specifying a run as account. Not the same thing as your app pool account - although your IIS credentials can use your app pool account.

提交回复
热议问题