【问题标题】:Give IIS privileges to edit scheduled Task授予 IIS 权限以编辑计划任务
【发布时间】:2015-05-04 07:16:20
【问题描述】:

我正在我的 ASP MVC5 应用程序中运行 powershell 脚本,如下所示

schtasks.exe /change /tn TestTask /sd 10/05/2015 

我需要知道如何通过 IIS 7.5 为我在 SERVER1 中的托管应用程序授予权限以从网页编辑此任务。

【问题讨论】:

    标签: c# asp.net powershell


    【解决方案1】:

    您可以在任何您希望的用户下运行您的网站。只需转到应用程序池 并定义站点应该由哪个用户运行。欲了解更多信息,您可以查看此链接:Specify an Identity for an Application Pool

    然后您就可以让该用户获得足够的权限来运行 Powershell shell 脚本

    https://technet.microsoft.com/en-us/library/hh849812.aspx

    【讨论】:

      【解决方案2】:

      您可以将具有必要权限的用户的凭据传递给 schtasks.exe。请参阅/u/p 参数。

      到目前为止,这比更改应用程序池身份的侵入性要小。

      【讨论】:

        猜你喜欢
        • 2011-04-15
        • 2017-01-21
        • 2023-03-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-01-18
        • 1970-01-01
        • 2023-03-08
        相关资源
        最近更新 更多