简体   繁体   English

无法从ASP.NET页运行.exe安装程序

[英]Unable to run .exe installer from ASP.NET page

I'm attempting to create an ASP.NET/C# page that runs a PowerShell script that will run an .exe installer. 我试图创建一个ASP.NET/C#页面,该页面运行将运行.exe安装程序的PowerShell脚本。 The ASP.NET page is currently running in IIS 6.0 on Windows Server 2003. The PowerShell script works correctly from the PS command line but when invoked from the ASP.NET page the page just hangs. ASP.NET页当前正在Windows Server 2003的IIS 6.0中运行。PowerShell脚本可从PS命令行正常运行,但是从ASP.NET页调用时,该页仅会挂起。 No processes are created and it appears that the server just appears to hang forever. 没有创建任何进程,并且看来服务器似乎永远挂起。 I have successfully gotten other PowerShell scripts that run simple Cmdlets or other scripts to work from the ASP.NET page. 我已经成功地从ASP.NET页面获得了运行简单Cmdlet的其他PowerShell脚本或其他脚本。

I've verified that the Website has script and execute permissions and that the ASP.NET page can see the script on disk. 我已验证该网站具有脚本和执行权限,并且ASP.NET页可以在磁盘上看到该脚本。 When I run the script on the command line I am an Admin user, I've checked the user in the ASP.NET page and its running as the 'NT AUTHORITY\\NETWORK SERVICE' user. 当我在命令行上运行脚本时,我是管理员用户,已在ASP.NET页中检查了该用户,并以“ NT AUTHORITY \\ NETWORK SERVICE”用户身份运行该脚本。 I gave that user full permissions to execute the script but there was no change. 我授予该用户执行脚本的全部权限,但没有任何更改。

I feel like the issue is 1. User permissions which I am still a novice on in Windows. 我觉得问题出在1.用户权限,我仍然是Windows上的新手。 2. Some prompt is being given to execute the script that I am not answering, however no Windows or prompts are displayed when this is run from the ASP.NET page, (the installer is shown when running the script from the command line). 2.正在给出一些提示来执行我没有回答的脚本,但是从ASP.NET页运行该脚本时,不会显示Windows或提示(当从命令行运行脚本时会显示安装程序)。

What you can do for a work-around: 您可以采取的解决方法:

  • reconfigure your application pool to run under a domain account rather than "Network service" 重新配置您的应用程序池以在域帐户而不是“网络服务”下运行
  • when running your page, impersonate into the application pool's identity and run the executable with that account. 运行页面时,请模拟应用程序池的标识并使用该帐户运行可执行文件。 See examples of how to do that here . 在此处查看如何执行操作的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM