如何防止用户停止Windows服务并从SCM和任务计划程序中删除任务

如何防止用户停止Windows服务并从SCM和任务计划程序中删除任务

问题描述:

我在 C#with Visual Studio 2012 中有一个Windows应用程序,我在其中创建了一个 Windows服务和一个任务来实现此目的我的申请该应用程序基于.Net framework 3.0构建。我的应用程序使用WIX成功安装。 Windows服务和任务也在各自的位置注册。 Windows服务也正在安装并通过WIX运行。应用程序的卸载也正确发生。



我可以在进程选项卡上看到SCM下的Windows服务和服务进程(myservice.exe)(显示全部流程)。可以从SCM停止Windows服务,也可以结束该过程。



是否可以防止我的用户意外或故意停止服务并删除任务?



任何形式的帮助都将受到高度赞赏。

I have a windows application in C# with Visual Studio 2012, where I have created a Windows Service and a Task to serve the purpose of my application. The application is built on .Net framework 3.0. My application is getting installed successfully using WIX. Windows service and Task is also getting registered at their respective places. The Windows Service is also getting installed and running through WIX. The uninstallation of the application is also happening rightly.

I can see my Windows Service listed under SCM and service process (myservice.exe) at the Process Tab (show all processes). The Windows Service can be stopped from SCM or the process can be ended.

Is it possible to prevent my users from accidentally or intentionally stop the Service and delete the Task?

Any kind of help will be highly appreciated.

如果您的用户每天都很正常用户他们的机器上的帐户(不是管理员),如果您的服务以LocalSystem运行,他们已经无法停止服务并终止服务,也无法将其卸载。



如果你犯了一个巨大的错误,就是让每个人都成为他们机器上的管理员,你完全没有办法阻止他们杀掉它。这可能是你们让用户安装软件时你们所做的。



想一想。如果用户可以安装它,他们也可以卸载它。如果用户都是管理员,则无法阻止它。
If your users are normal every day User account (not Administrators) on their machines, they already can NOT stop the services and kill them, provided your service runs as LocalSystem, nor can they uninstall it.

If you made the monumental mistake of making everyone an Administrator on their machines, you have no way at all of preventing them from killing it off. This is probably what you guys did as you're letting users install software.

Think about it. If the users can install it, they can uninstall it too. There's no way you can prevent it if the users are all Administrators.