0

I wrote an asp.net web application, which launches a powershell script. The program ran without any issue when I debugged it in my development environment. After publishing and deploying the asp.net web application (by the way the target server is the same machine localhost), by clicking the button for launching the powershell script, nothing happened. It means the powershell script was not launched. I attached the debugger to the deployed asp.net and saw that the Shell.Invoke() was hit as before and the command was also correct. However Shell.Invoke() returned immediately and the powershell script was not launched. In my environment the powershell execution policy is RemoteSigned. Since the program in the development environment works perfectly and in the deployed case also hits the same code, I don't think it has to do with the code but more with security, certification,...???

Has anyone experienced the same? If yes, please advise me what I should do.

I appreciate your help in advance.

Thx

1 Answer 1

1

Might have something to do with the application pool identity not having the right permissions:

screenshot

You might want to run your PowerShell invocation from a system service with explicit permissions though. That will take a steeper curve though.

Sign up to request clarification or add additional context in comments.

1 Comment

Thx. I looked into it. Your comment was helpful but still get the same issue. I think it has to do with the security. I need to dig further.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.