我正在使用ServiceController类从C#程序集远程closuresIIS。 我想知道什么是最低级别的privlidges我需要通过networking做到这一点,在我目前的testing中,我使用pipe理员,它工作正常,但是当我迁移到生产,我将使用AD组,并需要给它的安全性是否正确?
// Make a call to IIS to shutdown the service. ServiceController sc = new ServiceController(serviceName, serverName); //Can we stop the service if (sc.CanStop) { //Stop it sc.Stop(); }
干杯,Conor
Windows服务由访问控制列表(ACL)保护。 这些文件访问控制列表用于保护文件,目录,注册表项等。
如果您的AD用户对您所控制的服务没有足够的权限,则需要在部署到Production之前(或作为其一部分)安排适当的权限(即SERVICE_STOP)。
像SUBINACL这样的命令行工具可以用来操纵Windows服务上的ACL。