0

We have hosted an application which access the powershell script from C# code. It is running perfectly on localhost. But when we hosted that application script is running with the service account rather user account.

We've enabled windows authentication in application, but the Powershell command is running with service account which is used as IIS Application pool.

Thanks in Advance!!

7
  • Welcome to StackOverflow. We all enjoy helping folks, but there are rules to follow in order for folks to assist: How do I ask a good question? - How to create a Minimal, Reproducible Example - Why is "Can someone help me?" not an actual question?. Commented May 4, 2020 at 23:20
  • Running PowerShell using a service account is a common thing, with lots of articles all over the web. running powershell with a service account Commented May 4, 2020 at 23:23
  • could you please share your sample code to reproduce the issue? also, share your web.config file. try to set the <authentication mode="Windows"> </authentication> under <System.Web> section in web.config file. make sure other authentication mode is disabled. Commented May 5, 2020 at 8:00
  • @postanote thanks for your response. We are able to run the powershell using Service account. I don't want to use service account to run the script. I want the logged in user account to run the powershell window with his own credentials. Commented May 5, 2020 at 10:49
  • @JalpaPanchal, we have enabled the windows authentication in our hosted website. But the powershell window is not running with the User account Commented May 5, 2020 at 10:51

0

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.