How to Start/Stop a Windows Service from an ASP.NET app - Security issues

前端 未结 6 1314
没有蜡笔的小新
没有蜡笔的小新 2020-12-04 18:33

Here\'s my Windows/.NET security stack:

  • A Windows Service running as LocalSystem on a Windows Server 2003 box.
  • A .NET 3.5 Website running on the same
6条回答
  •  感情败类
    2020-12-04 19:13

    Update for IIS 8 (and maybe some slightly earlier versions)

    The usergroup IIS_WPG does not exist anymore. It has changed to IIS_IUSRS.

    Also, to start stop a service it is not neccesary to give full permissions (F). Permissions to start, stop and pause a service (TOP) should be enough. As such the command should be:

    subinacl /service {yourServiceName} /grant=IIS_IUSRS=TOP

    Note that you need to point the command prompt (preferably elevated to run as administrator) to C:\Windows\System32 Folder before running this command.

    Also make sure that you have copied the subinacl.exe file to C:\Windows\System32 from the installation directory if there is an error.

提交回复
热议问题