简体   繁体   中英

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. 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. 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.

I've verified that the Website has script and execute permissions and that the ASP.NET page can see the script on disk. 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. 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. 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).

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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