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


I have some Windows services that are written in C #. When a person stops or starts the service, I would like to be able to determine who he was and log on that information.

I have the environment User name tried to log in, but to evaluate the system also on my local machine.

In addition, the time of these services is running on the Windows 2000 server.

service control manager log within the event viewer (control panel | administrative tools | event viewer) on the system tab Which starts and closes each event. I just tested myself and saw the results. It leads me to two things:

  1. You may query or hook those incidents from the Service Control Manager, or
  2. You can of course Only ask can

Hopefully leads you to your solution.


Comments