Is it possible to log who started or stopped a windows service?

前端 未结 5 1857
青春惊慌失措
青春惊慌失措 2020-12-16 12:21

I have some windows services written in C#. When somebody stops or starts the service, I would like to be able to determine who it was and log that information.

I t

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-16 12:55

    You can enable auditing according to this article

    http://windowsitpro.com/systems-management/access-denied-auditing-users-who-might-be-starting-and-stopping-services

    Additionally, it may be a good idea to alert email to yourself in OnStop() method.

提交回复
热议问题