Restart Server from ASP.NET application when AppPool is ran under LocalSystem or LocalService account

后端 未结 2 1794
夕颜
夕颜 2020-12-17 05:10

Is it possible to restart server from ASP.NET application that is hosted by LocalSystem or LocalService account? This is working when I create custom administrative account

2条回答
  •  盖世英雄少女心
    2020-12-17 05:38

    You could have your code impersonate a specific account when making that call or stand up a web service with one account. I recommend the web service, worst case is you update one app pool. You could also lock down the web service internally to only your applications.

    A small C# Class for impersonating a User

提交回复
热议问题