IIS LocalSystem only will run my exe

2019-08-10 09:07发布

IIS on WindowsServer 2012, ASP.NET MVC

It is very bad to run an IIS 8.5 site as LocalSystem, but that is the only way I can get this exe to run. I need to be able to have the site run this:

                var pdfProcess = new Process();
                pdfProcess.StartInfo.FileName =  SomeExeInProgramFiles;
                pdfProcess.StartInfo.Arguments = stuff;
                pdfProcess.StartInfo.WorkingDirectory = docPath; //!!!!This is really important!!!!!
                pdfProcess.Start();

Running windows 2012, how can I let my AppPoolIdentity site run the above exe (only) from Program Files?

I have granted full control to the folder holding the exe to IIS APPPOOL\my pool name as a test, but still it won't run. Only if I set the app pool to run under LocalSystem (yicks)

Note: The EXE is a tool that needs to run to do tasks. We have no other option than to run it on request from the web site. We didn't write or have access to the exe.

1条回答
混吃等死
2楼-- · 2019-08-10 09:33

Try to set the Load User Profile = True in the Application Pools Advanced Settings.

Then I think you should be able to execute the process using the ApplictionPoolIdentity, so you can avoid using the LocalSystem account.

Load User Profile in the Application Pools Advanced Settings dialog.

查看更多
登录 后发表回答