views:

38

answers:

1

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

+1  A: 

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.
naivists
Thank you for the quick, concise and correct solution! I ran IIS as the Local System for a test and it worked! Windows gives a big warning not to do this so create a new user with only your required permissions before you actually give this to users!
Patrick Auld