I have developed an ASP.NET MVC Web Application to execute PowerShell scripts.
I am using the VS web server and can execute scripts fine.
However, a requirement
Does this blog post help? Comes straight from the PowerShell devs. Essentially, PowerShell starts a new thread to run the pipeline, and since .NET2.0 doesn't allow the thread to use the impersonation from the calling thread, it fails.
http://blogs.msdn.com/powershell/archive/2007/09/10/impersonation-and-hosting-powershell.aspx